是否可以使用 SSL 连接到客户端只有根证书但服务器同时具有根证书和中间证书的站点?
我正在尝试使用 HttpUrlConnection 与包含我的根的 TrustManager 进行连接,但出现通常的握手错误:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException:
Certificate chaining error
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
我知道一般的解决方案是安装中间证书,但我想避免不断地一次性获得供应商 X 的新中间证书。
我熟悉使用接受所有内容的 TrustManager,但这不是一种选择。