Why does Java’s SSLSocket send a version 2 client hello?

Sun’s JSSE doesn’t support SSLv2 but it supports the SSlv2ClientHello, to support some SSL servers that require it. You can turn it off by removing it from the enabled protocols.

IBM’s JSSE does support SSLv2 entirely.

From the JSSE Reference Guide:

For example, some older server
implementations speak only SSLv3 and
do not understand TLS. Ideally, these
implementations should negotiate to
SSLv3, but some simply hangup. For
backwards compatibility, some server
implementations (such as SunJSSE) send
SSLv3/TLS ClientHellos encapsulated in
a SSLv2 ClientHello packet. Some
servers do not accept this format, in
these cases use setEnabledProtocols to
disable the sending of encapsulated
SSLv2 ClientHellos.

I imagine ‘server implementations’ should read ‘SSL implementations’ above.

EDIT: thanks for citing my book!

Leave a Comment