Java: 信任锚点参数必须为非空 (openjdk)

huangapple 未分类评论54阅读模式
英文:

Java: the trustAnchors parameter must be non-empty (openjdk)

问题

我想通过HttpURLConnection连接到一个网站。首先,我遇到了javax.net.ssl.SSLHandshakeException,因为我忘记了通过keytool -importcert为站点在.../lib/security下添加carcerts。之后,连接可以轻松地建立起来。

然而,今天它不再工作了,没有改变代码或任何其他内容。似乎抛出了以下异常:

 javax.net.ssl.SSLException: 意外错误:java.security.InvalidAlgorithmParameterException: 
 trustAnchors参数必须是非空的。

尽管网络上有很多可能的解决方案,但没有一个可以帮助我摆脱这个错误。

也许在eclipse内部需要进行一些设置?

英文:

I want to connect to a site via HttpURLConnection. First of all I stumbled accross javax.net.ssl.SSLHandshakeException, as I've forgotten to add the carcerts via keytool -importcert for the site under .../lib/security. After that, the connection could have been established with ease.

However, today it's not working anymore, without changing code nor anything else. Following exception is seemed to be thrown:

 javax.net.ssl.SSLException: Unexpected error: java.security.InvalidAlgorithmParameterException: the 
 trustAnchors parameter must be non-empty

Even though there are plenty of possible solutions on the net, none of them could me get rid off this error.

Maybe there is some setup needed to be done inside eclipse?

huangapple
  • 本文由 发表于 2020年4月3日 19:57:28
  • 转载请务必保留本文链接:https://java.coder-hub.com/61011392.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定