【问题标题】:RSA Premaster secret errorRSA Premaster 密码错误
【发布时间】:2014-01-27 19:44:50
【问题描述】:

我继承了一些代码,不知道它在做什么(我评论了我认为它在做什么),原来的编码员几年前离开了我的组织......我希望这里的伟大社区至少可以指出我关于这段代码可能试图做什么的一些方向,以及我可以从哪里开始寻找解决方案......

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());

堆栈跟踪

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)
  1. 这被认为是一种什么样的连接?
  2. RSA Premaster Secret 到底是什么?
  3. 什么/我应该从哪里开始寻找/研究以了解发生了什么?

谢谢!

【问题讨论】:

    标签: java http


    【解决方案1】:

    我今天在使用我们的网络应用时遇到了类似的问题。系统管理室的人没有问任何人就更新了Java版本。经过几个小时的搜索,我发现了一些有用的东西。 如果您仍然感兴趣,请点击以下链接: https://community.oracle.com/thread/1533888

    解决方案:只需从您的服务器 Classpath 中删除更新的 java 版本并尝试安装旧的 java 版本。

    Stackoverflow 中的类似问题: SSL IOExceptionjavax.net.ssl.SSLKeyException: RSA premaster secret error

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-27
      • 1970-01-01
      • 1970-01-01
      • 2017-06-20
      相关资源
      最近更新 更多