首页 > 解决方案 > Websphere trust.p12 vs cacert 存储

问题描述

我们使用 Spring Integration 连接到 https/ssl 外部系统。使用外部主机和端口 443 添加证书后,从端口检索。证书存在。

但是申请一直失败

>     ERROR 2886 --- [ebContainer : 1] c.i.w.w.servlet.ServletWrapper           : SRVE0014E: Uncaught service() exception root cause
> dispatcherServlet:
> org.springframework.web.util.NestedServletException: Request
> processing failed; nested exception is
> org.springframework.ws.client.WebServiceIOException: I/O error:
> com.ibm.jsse2.util.h: 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=ODC somest Root CA - G1, O=ODC sonst, C=TR is
> not trusted; internal cause is:
>             java.security.cert.CertPathValidatorException: Certificate chaining error; nested exception is
> javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.h: 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=ODC somest Root CA - G1, O=ODC sonst, C=PR is
> not trusted; internal cause is:
>             java.security.cert.CertPathValidatorException: Certificate chaining error

如果我运行 keytool 并将证书导入 cacert,则该应用程序可以工作。但是这个解决方案不被维护团队接受,因为它没有出现在 websphere 控制台中。在春季集成请求中有什么可以更改的吗所以我可以请任何人帮助我了解问题和解决方法吗?

更新

/srv/opt/IBM/WebSphere/AppServer/java/bin/keytool -list -v -keystore /srv/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/K1Node01Cell/nodes/K1Node01/trust.p12 -storepass WebAS -storetype PKCS12

显示证书条目...不确定如何确认它是完整的还是不正确的

问题:

应该从端口检索更新 cacert 文件吗?cacert 在 websphere jre security 中,而 trust.p12 在 profile/../nodes 中

更新 2

我已启用跟踪并查看以下日志。是 spring 试图调查 cacerts...还是正常的,因为它是 WebSphere 使用的 JRE 的一部分

> [18-2-19 13:44:59:154 ] 00000063 SystemOut     O 2019-02-18
> 13:44:59.153  INFO 30426 --- [ver.startup : 0]
> pertySourcedRequestMappingHandlerMapping : Mapped URL path
> [/v2/api-docs] onto method [public
> org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json>
> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
> [18-2-19 13:44:59:826 ] 00000063 SystemOut     O keyStore is:
> /srv/opt/IBM/WebSphere/AppServer/java/8.0/jre/lib/security/cacerts
> [18-2-19 13:44:59:826 ] 00000063 SystemOut     O keyStore type is: jks
> [18-2-19 13:44:59:827 ] 00000063 SystemOut     O keyStore provider is:
> [18-2-19 13:44:59:827 ] 00000063 SystemOut     O init keystore
> [18-2-19 13:44:59:906 ] 00000063 SystemOut     O SSLContextImpl: 
> Using X509ExtendedKeyManager com.ibm.jsse2.ay [18-2-19 13:44:59:908 ]
> 00000063 SystemOut     O trustStore is:
> /srv/opt/IBM/WebSphere/AppServer/java/8.0/jre/lib/security/cacerts

标签: sslwebspherespring-integrationtruststore

解决方案


仅回答您的最后一个问题,不,从端口检索不应更新cacerts。它应该像trust.p12您提到的文件一样更新文件。

但是,您的路径表明您确实有一个带有单元和节点的 ND 环境。并且您已导入 NodeDefaultTrustStore。我们总是导入 CellDefaultTrustStore。你可以试试吗?


推荐阅读