我有一个Web应用程序,该应用程序调用通过SSL保护的SOAP Web服务。(https://zzzzzzzzzzzz/xxxxx
)。
服务器发送两个证书(Root和Leaf),因此我使用属性导入了两个证书:com.ibm.websphere.ssl.retrieveLeafCert
。
要在Websphere上启用ssl验证,我只需将证书添加到websphere中:
SSL证书和密钥管理->密钥库和证书-> NodeDefaultTrustStore->签署者证书->从端口检索:
问题是,webshphere不信任证书,并给我这个堆栈跟踪信息,
used by: javax.net.ssl.SSLHandshakeException: SSLHandshakeException invoking `https://------------------------------` : com.ibm.jsse2.util.j: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is:
java.security.cert.CertPathValidatorException: T`he certificate issued by CN=-------------------------------------------------------------------- is not trusted`; internal cause is:
java.security.cert.CertPathValidatorException: Certificate chaining error
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.6.0]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:56) ~[na:1.6.0]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39) ~[na:1.6.0]
at java.lang.reflect.Constructor.newInstance(Constructor.java:527) ~[na:1.6.0]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1338) ~[cxf-rt-transports-http-2.7.4.jar:2.7.4]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1322) ~[cxf-rt-transports-http-2.7.4.jar:2.7.4]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:622) ~[cxf-rt-transports-http-2.7.4.jar:2.7.4]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:354) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:385) ~[cxf-rt-frontend-jaxws-2.7.4.jar:2.7.4]
... 100 common frames omitted
`Caused by: javax.net.ssl.SSLHandshakeException`: com.ibm.jsse2.util.j: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is:
java.security.cert.CertPathValidatorException: `The certificate issued by CN=--------------------------------------------------------- is not trusted`; internal cause is:
java.security.cert.CertPathValidatorException: Certificate chaining error
at com.ibm.jsse2.o.a(o.java:8) ~[na:6.0 build_20130515]
at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:549) ~[na:6.0 build_20130515]
at com.ibm.jsse2.kb.a(kb.java:355) ~[na:6.0 build_20130515]
at com.ibm.jsse2.kb.a(kb.java:130) ~[na:6.0 build_20130515]
at com.ibm.jsse2.lb.a(lb.java:135) ~[na:6.0 build_20130515]
at com.ibm.jsse2.lb.a(lb.java:368) ~[na:6.0 build_20130515]
at com.ibm.jsse2.kb.s(kb.java:442) ~[na:6.0 build_20130515]
at com.ibm.jsse2.kb.a(kb.java:136) ~[na:6.0 build_20130515]
at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:495) ~[na:6.0 build_20130515]
at com.ibm.jsse2.SSLSocketImpl.h(SSLSocketImpl.java:223) ~[na:6.0 build_20130515]
at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:724) ~[na:6.0 build_20130515]
at com.ibm.jsse2.SSLSocketImpl.startHandshake(SSLSocketImpl.java:81) ~[na:6.0 build_20130515]
at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:8) ~[na:6.0 build_20130515]
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:20) ~[na:6.0 build_20130515]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1043) ~[na:1.6.0]
at com.ibm.net.ssl.www2.protocol.https.b.getOutputStream(b.java:85) ~[na:6.0 build_20130515]
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:168) ~[cxf-rt-transports-http-2.7.4.jar:2.7.4]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1282) ~[cxf-rt-transports-http-2.7.4.jar:2.7.4]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1233) ~[cxf-rt-transports-http-2.7.4.jar:2.7.4]
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:195) ~[cxf-rt-transports-http-2.7.4.jar:2.7.4]
at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) ~[cxf-api-2.7.4.jar:2.7.4]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1295) ~[cxf-rt-transports-http-2.7.4.jar:2.7.4]
... 110 common frames omitted
`Caused by: com.ibm.jsse2.util.j: PKIX path building failed:` java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is:
java.security.cert.CertPathValidatorException: T`he certificate issued by CN=-------------------------------------------- is not trusted`; internal cause is:
java.security.cert.CertPathValidatorException: Certificate chaining error
at com.ibm.jsse2.util.h.b(h.java:39) ~[na:6.0 build_20130515]
at com.ibm.jsse2.util.h.b(h.java:21) ~[na:6.0 build_20130515]
at com.ibm.jsse2.util.g.a(g.java:1) ~[na:6.0 build_20130515]
at com.ibm.jsse2.pc.a(pc.java:36) ~[na:6.0 build_20130515]
at com.ibm.jsse2.pc.checkServerTrusted(pc.java:19) ~[na:6.0 build_20130515]
at com.ibm.jsse2.pc.b(pc.java:51) ~[na:6.0 build_20130515]
at com.ibm.jsse2.lb.a(lb.java:65) ~[na:6.0 build_20130515]
... 128 common frames omitted
Caused by: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.
at com.ibm.security.cert.PKIXCertPathBuilderImpl.engineBuild(PKIXCertPathBuilderImpl.java:411) ~[na:na]
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:258) ~[na:na]
at com.ibm.jsse2.util.h.b(h.java:107) ~[na:6.0 build_20130515]
... 134 common frames omitted
Caused by: java.security.cert.CertPathValidatorException: The certificate issued by CN=-------------------------------------------------------
at com.ibm.security.cert.BasicChecker.<init>(BasicChecker.java:111) ~[na:na]
at com.ibm.security.cert.PKIXCertPathValidatorImpl.engineValidate(PKIXCertPathValidatorImpl.java:178) ~[na:na]
at com.ibm.security.cert.PKIXCertPathBuilderImpl.myValidator(PKIXCertPathBuilderImpl.java:737) ~[na:na]
at com.ibm.security.cert.PKIXCertPathBuilderImpl.buildCertPath(PKIXCertPathBuilderImpl.java:649) ~[na:na]
at com.ibm.security.cert.PKIXCertPathBuilderImpl.buildCertPath(PKIXCertPathBuilderImpl.java:595) ~[na:na]
at com.ibm.security.cert.PKIXCertPathBuilderImpl.engineBuild(PKIXCertPathBuilderImpl.java:357) ~[na:na]
... 136 common frames omitted
Caused by: java.security.cert.CertPathValidatorException: Certificate chaining error
at com.ibm.security.cert.CertPathUtil.findIssuer(CertPathUtil.java:298) ~[na:na]
at com.ibm.security.cert.BasicChecker.<init>(BasicChecker.java:108) ~[na:na]
... 141 common frames omitted
只需使用Installcert.java,并在-
Djavax.net.ssl.trustStore =
jssecacerts(jssecacerts是InstallCert.java生成的文件)中运行测试,即可在我的本地环境中测试相同的代码。
我测试了一百万个Websphere配置。
唯一有效的过程是此链接中描述的过程:
http://blog.xebia.com/2012/10/01/mutual-ssl-authentication-using-websphere-
application-server-and-cxf/
通过定义cxf intercpter:
<cxf:bus>
<cxf:outInterceptors>
<bean class="---------------------.WebsphereSslOutInterceptor" />
</cxf:outInterceptors>
</cxf:bus>
有关更多详细信息,请参见:
https://github.com/vlussenburg/websphere-cxf-extensions#websphere-cxf-
extensions
非常感谢您的帮助。
我遇到了Android4设备的一个问题,它在连接到服务器时收到以下异常: 但出于某种原因,我不明白它在Android4版本中开始失败了。 我尝试了信任所有证书的解决方案[LINK],它起作用了,但这显然存在安全问题,比如将您的应用程序暴露于“中间人”攻击 如何实现具有默认行为但仅将服务器的证书白名单的TrustManager。 在证书链给了我两个证书的格式: 用获得的url和证书替换了示例中的ur
我正试图将我的计算机配置为信任用于测试网站的自签名证书。然而,我在Firefox上遇到了一些问题。Chrome和IE都没问题。 我做了以下几点。 使用OpenSSL创建2048位pem rsa密钥和crt 从密钥和crt文件创建pfx文件 使用MMC将pfx导入到服务器上的个人证书存储中 将IIS配置为使用站点的证书 在客户端PC上 null 我还尝试将证书直接添加到Firefox的权限列表中。它
我刚刚在Google Cloud上的VM上设置了我的Neo4j服务器,我使用的是企业版4.1.1,并且我已经完成了David Allen关于如何使用LetsEncrypt获得证书的精彩帖子(在这里)。 这一切都工作得很好,我现在有了一个完全安全的Neo4j服务器,我可以通过浏览器()使用我的主机名访问它。但是,我现在在让我的应用程序使用javascript驱动程序连接到服务器时遇到了问题。 我不断
我正在使用OpenSSL以避免为此付费。我的服务器正在运行IIS 8和Windows server 2012。 我创建证书的方式是: openssl请求-new-key cakey.pem-x509-days 1825-extensions v3_ca-out ca.crt 最后,我使用以下内容签署了证书请求: openssl x509-req-days 365-in certreq.txt-ca
问题内容: android应用有三台主机进行身份验证和授权。最终主机是REST API。首次使用Oauth身份验证和授权过程,它可以正常工作。 但是,如果 用户 在登录并访问REST API提供的服务后 杀死了该应用程序 ,然后再次打开该应用程序,则会出现此问题。 在这段时间内,身份验证和授权过程不会发生,只有REST API会发生。 这是造成原因, 但在首次使用(登录然后使用该应用程序)期间正在
似乎HttpClient/HttpClientHandler没有提供忽略不信任证书的选项,比如WebRequest使您能够忽略不信任证书(尽管使用)。 任何帮助都将不胜感激!