`p12` file work in Firefox RestClient but not work in WebSphere

痞子三分冷 提交于 2019-12-25 02:12:20

问题


I have a java web application that runs in WebSphere that need to call to third party service (IBM) to get some response.

At first IBM give me a p12 file, which is contain client certificate, and I test it in Firefox RestClient, the call success and I am getting response code 200 in the RestClient. Else, I will get 403 forbidden. So this is proof that the p12 provided by third party is correct. Please correct me if my statement is wrong.

Thus, I happily import this p12 file into my CellDefaultKeyStore to test the connection on my application. Unfortunately, after I import this p12 file, the nodes status become "unknown", and I cant even "synchronize" them. And when I check server log, I keep seeing

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 xxx is not trusted; internal cause is: 
    java.security.cert.CertPathValidatorException: Certificate chaining error

After that I remove it from CellDefaultKeyStore try to import it into NodeDefaultKeyStore, the node issue gone, the node can sync back and my app can call to the third party successfully. I think this is done of my job today, however, this solution is not stable, its only work some times, not every time. The node status will still become "unknown" after a moment, or, if I run ./stopManager.sh and ./startManager.sh, the node issue will immediately come back.

I have try run ./stopNode.sh and ./startNode.sh, there are no error in the log of this 2 shell script. But the WAS Console UI there still showing status is unknown, and I cant even stop start my server through WAS Console.

At first I am thinking its maybe display issue, but this issue will solve if I delete the p12 file from my NodeDefaultKeyStore.

I try google around but end up still cant find any clue. I am not sure is it my configuration or the p12 file having problem.

Which log should I refer to see why the node status will become unknown, or what else I can continue to debug/troubleshoot on this?


回答1:


You received the certificate for an external service and you want code in Websphere to connect to that service right? The default cell store is not the place to put external connection`s certificates.

Put it in the Trusted keystore. This will tell WebSphere to trust that external connections certificate, enabling your code to connect to it.

You can do it via the console, or using iKeyman directly on the file.

That being said, do not mess with the default certificate in the default keystore. @dbreaux is right on that in the comments.



来源:https://stackoverflow.com/questions/55922440/p12-file-work-in-firefox-restclient-but-not-work-in-websphere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!