Receiving SSLHandshakeException: handshake_failure despite my client ignoring all certs

后端 未结 7 1392
北荒
北荒 2020-12-05 03:01

I have a Java program that connects to a webserver using SSL/TLS, and sends various HTTP requests over that connection. The server is localhost and is using a self-signed ce

7条回答
  •  醉话见心
    2020-12-05 03:54

    Was this ever resolved?

    I had the exact same problem, essentially I was receiving a handshake exception immediately following the clientHello. So The chain of events was

    1. I would present my certificate to the server
    2. Server would imediately respond with a handshake failure. (I would not even get a Server Hello back).

    Eventually I found that the server was requiring a stronger encryption/decryption algorithm than what I Was supplying in the initial handshake phase (Ie. Client and Server could not agree on a mutual encryption algorithm to use for the ssl communication).

    I need to install the Unlimited Java JCE (Java Cryptography Extension Policy). There are export rules on using this, so if you ship your code overseas that may have implications..however this is what solved my problem.

    This link explains how to install the updated policies http://suhothayan.blogspot.com/2012/05/how-to-install-java-cryptography.html

    This was also a great link that helped me understand exactly what was going on https://support.f5.com/kb/en-us/solutions/public/15000/200/sol15292.html#id

    This may or may not be the issue, but when the handshake fails immediately after the client Hello, it looks like the client and the server can not agree on something (in many cases its the encryption algorithms that they will mutually need to communicate).

提交回复
热议问题