URL.openStream生成错误(javax.net.ssl.SSLException)

时间:2015-09-01 09:45:31

标签: java ssl ssl-certificate lotus-domino

我有一个问题,我使用静态Feed / URL(https)来读取数据。今天它停止了工作。 URL仍然可访问,内容就在那里。我发现Feed / URL最近获得了新证书。

URL page = new URL(url);
InputStream is = page.openStream(); // issue happens here
InputStreamReader isr = new InputStreamReader(is);
BufferedReader in = new BufferedReader(isr);

有人可以建议我应该检查/测试/做什么来解决我的问题吗?

这是错误StackTrace

Agent  error: javax.net.ssl.SSLException: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 64
Agent  error:  at com.ibm.jsse2.o.a(o.java:10)
Agent  error:  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:216)
Agent  error:  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:864)
Agent  error:  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:618)
Agent  error:  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:500)
Agent  error:  at com.ibm.jsse2.SSLSocketImpl.startHandshake(SSLSocketImpl.java:220)
Agent  error:  at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:184)
Agent  error:  at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:40)
Agent  error:  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1207)
Agent  error:  at com.ibm.net.ssl.www2.protocol.https.b.getInputStream(b.java:66)
Agent  error:  at java.net.URL.openStream(URL.java:1022)
Agent  error:  at JavaAgent.getURLContent(JavaAgent.java:23)
Agent  error:  at JavaAgent.NotesMain(JavaAgent.java:12)
Agent  error:  at lotus.domino.AgentBase.runNotes(Unknown Source)
Agent  error:  at lotus.domino.NotesThread.run(Unknown Source)
Agent  error: Caused by: 
Agent  error: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 64
Agent  error:  at com.ibm.crypto.provider.xc.a(Unknown Source)
Agent  error:  at com.ibm.crypto.provider.xc.a(Unknown Source)
Agent  error:  at com.ibm.crypto.provider.xc.a(Unknown Source)
Agent  error:  at com.ibm.crypto.provider.TlsMasterSecretGenerator.engineGenerateKey(Unknown Source)
Agent  error:  at javax.crypto.KeyGenerator.generateKey(Unknown Source)
Agent  error:  at com.ibm.jsse2.kb.b(kb.java:584)
Agent  error:  at com.ibm.jsse2.kb.a(kb.java:406)
Agent  error:  at com.ibm.jsse2.lb.a(lb.java:352)
Agent  error:  at com.ibm.jsse2.lb.a(lb.java:156)
Agent  error:  at com.ibm.jsse2.kb.s(kb.java:659)
Agent  error:  at com.ibm.jsse2.kb.a(kb.java:393)
Agent  error:  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:850)
Agent  error:  at com.ibm.jsse2.SSLSocketImpl.h(SSLSocketImpl.java:63)
Agent  error:  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:316)
Agent  error:  ... 10 more

1 个答案:

答案 0 :(得分:1)

我们已就此问题做了两件事:

  • 我们的Domino服务器。据我所知,当您升级Domino服务器时,它还会升级证书存储。
  • 我们还禁用了证书验证(即使它是一种肮脏的方式)。

您可以尝试我的解决方案Disabling certificate validation in Java

还可以查看那里的相关主题,也许它会对你有帮助。