English 中文(简体)
Java SSL 误差:无法检索证书链
原标题:Java SSL Error: Unable to retrieve certificate chain

我正在与一个名为“英雄”的产品合作,该产品是“蓝色分子”的走廊。 在这种特殊安装中,赫梅人需要使用一个服务器证书来签署即将发出的信息,我们用p12格式(pfx)从我们重新整合的合作伙伴那里下载该信息。

我已经核实,密码是正确的,我也具体指明了正确之处。

该证书也安装在Tomcat。 然后,我通过SSLShopper.com的一个工具对证书进行了测试。 该工具所报告的问题是,证书中的共同名称与服务器域名不符。 我不相信这可能是原因。 实际上,在申请证书时没有规定共同名称的地方。 他们要求获得姓名和姓等。

我要指出,根据SSLShopper测试,我的证明链是:

MyServer -> MyPartner

在我的合伙人不是协会的地方(这意味着它不是FF经证明的方言中所列的人之一)。

我希望有人在座,知道我会去做什么。

<>Hermes Configuation:

<component id="keystore-manager-for-signature" name="Key Store Manager for Digital Signature">
<class>hk.hku.cecid.piazza.commons.security.KeyStoreManager</class>
<parameter name="keystore-location" value="/opt/mycompany/certs/MyCert.pfx"/>
<parameter name="keystore-password" value="12345678"/>
<parameter name="key-alias" value="e38a429e10666c"/>
<parameter name="key-password" value="12345678"/>
<parameter name="keystore-type" value="PKCS12"/>
<parameter name="keystore-provider" value="org.bouncycastle.jce.provider.BouncyCastleProvider"/>
</component> 

Hermes Error:

2012-01-16 08:02:47 [Thread-28   ] <ERROR> <cecid.ebms.spa> <Cannot send the message>
hk.hku.cecid.piazza.commons.net.ConnectionException: Unable to send HTTP SOAP request
    by javax.net.ssl.SSLException: java.lang.RuntimeException: Unable to retrieve certificate chain
    by java.lang.RuntimeException: Unable to retrieve certificate chain
    by java.lang.NullPointerException
    at hk.hku.cecid.piazza.commons.soap.SOAPHttpConnector.send(SOAPHttpConnector.java:112)
    at hk.hku.cecid.ebms.spa.task.OutboxTask.sendMsgByHttp(OutboxTask.java:574)
    at hk.hku.cecid.ebms.spa.task.OutboxTask.execute(OutboxTask.java:444)
    at hk.hku.cecid.piazza.commons.module.ActiveThread.run(ActiveThread.java:90)
    at java.lang.Thread.run(Thread.java:619)

Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unable to retrieve certificate chain
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1623)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1586)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1569)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1154)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1131)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:904)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
    at hk.hku.cecid.piazza.commons.soap.SOAPHttpConnector.send(SOAPHttpConnector.java:84)
    ... 4 more
问题回答

SSL 陶瓷是潜在问题和配置不当的雷场: 如果看不到服务器正在交付哪些证书——可能或需要不止一个证书,则无法诊断。

一个很可能的原因是,服务器没有提供一套证书,以便建立完整的信托链。 或者说,信托途径可能不会出现在 Java根证书库。

在研究你的法典之前,确保首先检查这些问题。

你不能轻松地与浏览器核对信任链,因为浏览器收集中间证书,使您误认为服务器should。 国际电子计算中心也可在Windows Update静默地寻找缺失的中间商。

首先是virgin • 能够验证完全的信任道路: Install a new > Portable, or abolition of the index cache Store in hexachlorotus file cert8.db (time is medium trun).

If this fresh-out-of-the-box Firefox does accept the cert, check that the root cert is in the Java cert store.

只有在这样做之后,才开始删除该法典。

If anyone wants to dig much deeper into SSL and its problems, there s some Related talk slides [pdf] from chapter meeting of OWASP Manchester, UK

这可能不是上述问题的解决办法,但我们的伙伴们向我们派出了新的12座钥匙仓库,我随后在Tomcat和Hermes配置了这些仓库,此后,所有工作都是按预期进行的。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签