Java RSA Premaster 秘密错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21390157/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
RSA Premaster secret error
提问by Jason
I inherited some code, no clue what it's trying to do (I commented what i think its doing), the original coder left my organization years ago... I'm hoping the great community here can at least point me in some direction as to what this code might be trying to do, and where I can start looking for a solution...
我继承了一些代码,不知道它想做什么(我评论了我认为它在做什么),最初的编码员几年前离开了我的组织......我希望这里的伟大社区至少可以为我指明一些方向这段代码可能试图做什么,以及我可以从哪里开始寻找解决方案......
Java code
Java代码
//Read java.security file from JDK and create a Security provider from it
PropertyFileReader reader = new PropertyFileReader();
Security.addProvider(new IBMJSSEProvider());
Security.setProperty("ssl.SocketFactory.provider",
"com.ibm.jsse2.SSLSocketFactoryImpl");
System.getProperties().putAll(
reader.readProperties("security.properties"));
//Set some authentication stuff
Authenticator.setDefault(new PasswordAuthentication("User", "Password"));
// get url to servlet (note, actual application has valid url)
url = new URL("Connection URL");
// Set out HTTP URL connection
httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setRequestProperty("Authorization", "Basic ");
httpURLConnection.setDoInput(true);
httpURLConnection.setDoOutput(true);
httpURLConnection.setUseCaches(false);
httpURLConnection.setDefaultUseCaches(false);
httpURLConnection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
httpURLConnection.setRequestMethod("POST");
//EXCEPTION IS THROWN HERE!
DataOutputStream outputStream = new DataOutputStream(
httpURLConnection.getOutputStream());
Stack trace
堆栈跟踪
javax.net.ssl.SSLKeyException: RSA premaster secret error
at com.ibm.jsse2.fb.<init>(fb.java:38)
at com.ibm.jsse2.hb.a(hb.java:200)
at com.ibm.jsse2.hb.a(hb.java:70)
at com.ibm.jsse2.gb.n(gb.java:223)
at com.ibm.jsse2.gb.a(gb.java:170)
at com.ibm.jsse2.sc.a(sc.java:595)
at com.ibm.jsse2.sc.g(sc.java:284)
at com.ibm.jsse2.sc.a(sc.java:200)
at com.ibm.jsse2.sc.startHandshake(sc.java:205)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsU RLConnection.java:166)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1014)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.jav a:230)
- What kind of connection is this considered?
- What the heck is a RSA Premaster Secret?
- What / Where should I start looking / studying to understand whats going on?
- 这被认为是一种什么样的联系?
- RSA Premaster Secret 到底是什么?
- 什么/我应该从哪里开始寻找/学习以了解发生了什么?
Thanks!
谢谢!
回答by xmux
I had a similar issue today with our web app. The guys in system admin room updated the Java version without asking anyone. After hours of searching i found something useful. Here is the link if you are still interested: https://community.oracle.com/thread/1533888
我今天在我们的网络应用程序上遇到了类似的问题。系统管理室的人在没有询问任何人的情况下更新了 Java 版本。经过数小时的搜索,我发现了一些有用的东西。如果您仍然感兴趣,这里是链接:https: //community.oracle.com/thread/1533888
The solution: Just remove the updated java version from your server Classpath and try to install the old java version.
解决方案:只需从您的服务器类路径中删除更新的 java 版本并尝试安装旧的 java 版本。
similar question in Stackoverflow: SSL IOExceptionjavax.net.ssl.SSLKeyException: RSA premaster secret error
Stackoverflow 中的类似问题: SSL IOExceptionjavax.net.ssl.SSLKeyException: RSA premaster secret error