Is it possible to send sslv2 hello messages?? When I try initiating ssl handshake with a remote server, the default version is TLS
. I need to test if the serve accepts sslv2, therefore, I need to force my Java program to send sslv2 hello message. Is this possible? How? Please note that I need to this for testing only. I am not doing a real Java application.
Asked
Active
Viewed 3,652 times
1

Jury A
- 19,192
- 24
- 69
- 93
-
possible duplicate of [How to initiate ssl connection using SSLv2](http://stackoverflow.com/questions/12773692/how-to-initiate-ssl-connection-using-sslv2) – Bruno Nov 04 '12 at 14:18
2 Answers
2
Sun/Oracle Java has never supported SSLv2. It did support the SSLv2ClientHello message, for compatibility purposes, to negotiate SSLv3 or higher, but that was withdrawn in I think 1.7. IBM Java used to support SSLv2 but I can't speak for current versions.

user207421
- 305,947
- 44
- 307
- 483
1
SSLV2 is not supported, if you need to force SSLv2Hello
messages you can set a system property :
System.setProperty("https.protocols", "SSLv3,SSLv2Hello");
Or you can manage your sockets directly :
SSLContext context = SSLContext.getInstance("TLSv1");
SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sock = (SSLSocket) sslsocketfactory.createSocket("hostserver", 443);
String[] protocols = {"SSLv2Hello", "SSLv3", "TLSv1"};

Hugo Dozois
- 8,147
- 12
- 54
- 58

nate
- 11
- 1