我使用 HTTP 客户端发出一些 HTTPS POST 请求。一开始一切正常,但过了一段时间我遇到了异常。
Caused by: java.lang.RuntimeException: Could not generate DH keypair
at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:106)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:446)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:171)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1112)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:623)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
... 117 more
Caused by: java.security.InvalidAlgorithmParameterException: parameter object not a DHParameterSpec
at org.bouncycastle.jce.provider.JDKKeyPairGenerator$DH.initialize(Unknown Source)
at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:100)
... 125 more
BouncyCastle 似乎附加了一个问题,但我找不到任何有关它的信息!我尝试安装 Unlimited JCE Key 但它对我的问题没有影响。
如果有人可以帮助我,那就太好了!
谢谢。