英文:
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?
专注分享java语言的经验与见解,让所有开发者获益!
评论