Ssl Websphere trust.p12与cacert商店

Ssl Websphere trust.p12与cacert商店,ssl,websphere,spring-integration,truststore,Ssl,Websphere,Spring Integration,Truststore,我们正在使用Spring集成连接到https/ssl外部系统。使用外部主机和端口443添加证书后,从端口检索。该证书已存在 但应用程序一直失败 > ERROR 2886 --- [ebContainer : 1] c.i.w.w.servlet.ServletWrapper : SRVE0014E: Uncaught service() exception root cause > dispatcherServlet: > org.springfra

我们正在使用Spring集成连接到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控制台中。 在spring集成请求中有什么我可以更改的吗 因此,我可以请任何人帮助我了解问题和解决方法

更新

/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//节点内部

更新2

我已经启用了跟踪,并查看以下日志。是spring在尝试研究Cacert……还是这很正常,因为它是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
[18-2-19 13:44:59:154]00000063系统输出2019-02-18
>13:44:59.153信息30426---[版本启动:0]
>PertySourceRequestMappingHandlerMapping:映射的URL路径
>[/v2/api docs]到方法[public]
>org.springframework.http.ResponseEntity
>springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
>[18-2-19 13:44:59:826]00000063系统输出O密钥存储是:
>/srv/opt/IBM/WebSphere/AppServer/java/8.0/jre/lib/security/cacerts
>[18-2-19 13:44:59:826]00000063 SystemOut O密钥库类型为:jks
>[18-2-19 13:44:59:827]00000063 SystemOut O密钥库提供程序是:
>[18-2-19 13:44:59:827]00000063系统输出到初始化密钥库
>[18-2-19 13:44:59:906]00000063系统输出到SSLContextImpl:
>使用X509ExtendedKeyManager com.ibm.jsse2.ay[18-2-19 13:44:59:908]
>000000 63 SystemOut O trustStore是:
>/srv/opt/IBM/WebSphere/AppServer/java/8.0/jre/lib/security/cacerts

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


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

我遵循IBM链接并使用useSystemProperties()。这将在websphere中使用证书,否则将在Java服务器中查找证书


HttpClient theClient=HttpClientBuilder.create().useSystemProperties().addInterceptorFirst(新的RemoveSoapHeadersInterceptor()).build()

为了确定,您确实执行了节点同步并重新启动了应用部署到的服务器,对吗?我认为这是应用程序在信任存储中获取新证书所必需的。我不知道节点同步,但[每次小更改后]多次执行重新启动。您是否也添加了CA的根证书和中间证书?因为您正在谈论控制台,我想这是传统而不是自由?该错误中提到的证书就是您在WebSphere trust store signer certs中看到的证书?您检索到哪个信任存储?我的猜测是,你取回它的那个不是正在检查的那个;我以前见过这种情况。如果在向cacerts添加cert时它起作用,那么您可能会错误地创建SSL连接,从而覆盖WebSphere默认设置。确保您没有任何类似于以下内容的代码
Security.setProperty(“javax.net.ssl.trustStore”、“cacerts.jks”)在应用程序中。另外,请确保如果证书不是自签名的,则已将所有父证书添加到信任库。NodeDefaultTrustStore具有管理作用域(单元格):…:(节点):。。。我看不到你,嗯。。。节点是单元的一部分,但根本没有
单元:…
作用域的密钥/信任存储?如果是这样的话,这个问题可能与此有关。对不起,如果点点滴滴把你弄糊涂了。我曾经。。。而不是节点和单元的名称。我可以掩盖姓名并在明天更新不,我明白,我也在做同样的事情。我是问你是否根本没有任何单元范围的密钥/信任存储?只有单元和节点范围的?