Forum Stats

  • 3,838,749 Users
  • 2,262,397 Discussions
  • 7,900,750 Comments

Discussions

javax.net.ssl.SSLException: Error generating ECDH server key exchange

Hi Java Security,

I am implementing an SSL layer on a client-server network protocol. I use SSLEngine for wrapping and unwrapping the application buffers on the server. And the clients connect to the Secure server using javax.net.ssl.SSLSocket. I see the following exception on SSLHandshake, can anyone tell me what could be wrong?. and how we can avoid this?

javax.net.ssl.SSLException: Error generating ECDH server key exchange

              at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1306)

              at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:513)

              at sun.security.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.java:1177)

              at sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:1149)

              at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:469)

Caused by: javax.net.ssl.SSLException: Error generating ECDH server key exchange

              at sun.security.ssl.Handshaker.throwSSLException(Handshaker.java:1202)

              at sun.security.ssl.ServerHandshaker.clientHello(ServerHandshaker.java:780)

              at sun.security.ssl.ServerHandshaker.processMessage(ServerHandshaker.java:167)

              at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)

              at sun.security.ssl.Handshaker$1.run(Handshaker.java:808)

              at sun.security.ssl.Handshaker$1.run(Handshaker.java:806)

              at java.security.AccessController.doPrivileged(Native Method)

              at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1227)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

              at java.lang.Thread.run(Thread.java:745)

Caused by: java.security.SignatureException: Key not valid for use in specified state.

              at sun.security.mscapi.RSASignature.signHash(Native Method)

              at sun.security.mscapi.RSASignature.engineSign(RSASignature.java:390)

              at java.security.Signature$Delegate.engineSign(Signature.java:1160)

              at java.security.Signature.sign(Signature.java:553)

              at sun.security.ssl.HandshakeMessage$ECDH_ServerKeyExchange.<init>(HandshakeMessage.java:1012)

              at sun.security.ssl.ServerHandshaker.clientHello(ServerHandshaker.java:772)

              ... 9 more

This discussion has been closed.