java trustAnchors 参数必须非空

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48146461/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 09:59:48  来源:igfitidea点击:

the trustAnchors parameter must be non-empty

javasslssl-certificatetruststore

提问by Shakir Husain

I am trying to retrieve an SSL certificateand to call a soap webservice via that but getting stuck due to below issue

我正在尝试检索 SSL 证书并通过该证书调用 soap 网络服务,但由于以下问题而卡住

I tried all the solutions provided over stack overflow but it's not working at all..

我尝试了通过堆栈溢出提供的所有解决方案,但它根本不起作用..

Please let me know what is the solution of this problem, I am stuck badly...

请让我知道这个问题的解决方案是什么,我被卡住了...

Context:   WSWS3713E: Connection to the remote host xxx.xx.com:443 failed
Received the following error:
java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

回答by Eugène Adell

It looks like your server is returning an empty certificate. You should check, for example, with your browser if there really is a certificate behind this URL you are calling (click on the lock near just next to the URL in the address bar). You say you tried all solutions, but you're not telling which ones. You can run your client with this jvm options to make it more verbose : -Djavax.net.debug=ssl ; come back with the trace and we'll look at it.

您的服务器似乎正在返回一个空证书。例如,您应该使用浏览器检查您正在调用的 URL 后面是否真的有证书(单击地址栏中 URL 旁边的锁)。你说你尝试了所有的解决方案,但你没有告诉哪个解决方案。您可以使用此 jvm 选项运行您的客户端以使其更加详细: -Djavax.net.debug=ssl ;带着痕迹回来,我们会看看它。