我使用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,但它对我的问题没有影响。
如果有人可以帮助我,那就太好了!
感谢。