Skip to content

Instantly share code, notes, and snippets.

@MikeN123
Created January 6, 2015 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeN123/15ca4d45c50e7c3dfd57 to your computer and use it in GitHub Desktop.
Save MikeN123/15ca4d45c50e7c3dfd57 to your computer and use it in GitHub Desktop.
Index: src/main/net/sourceforge/jtds/ssl/Ssl.java
===================================================================
--- src/main/net/sourceforge/jtds/ssl/Ssl.java (revision 1289)
+++ src/main/net/sourceforge/jtds/ssl/Ssl.java (working copy)
@@ -44,6 +44,8 @@
String SSL_AUTHENTICATE = "authenticate";
/** Size of TLS record header. */
int TLS_HEADER_SIZE = 5;
+ /** SSLv2 Client hello message */
+ int TYPE_SSLV2CLIENTHELLO = 0x80;
/** TLS Change Cipher Spec record type. */
byte TYPE_CHANGECIPHERSPEC = 20;
/** TLS Alert record type. */
Index: src/main/net/sourceforge/jtds/ssl/TdsTlsOutputStream.java
===================================================================
--- src/main/net/sourceforge/jtds/ssl/TdsTlsOutputStream.java (revision 1289)
+++ src/main/net/sourceforge/jtds/ssl/TdsTlsOutputStream.java (working copy)
@@ -134,7 +134,7 @@
int length = ( ( b[off + 3] & 0xFF ) << 8 ) | ( b[off + 4] & 0xFF );
// check to see if probably a SSL client hello
- if( contentType < Ssl.TYPE_CHANGECIPHERSPEC || contentType > Ssl.TYPE_APPLICATIONDATA || length != len - Ssl.TLS_HEADER_SIZE )
+ if( contentType == Ssl.TYPE_SSLV2CLIENTHELLO )
{
// assume SSLv2 client hello
putTdsPacket( b, off, len );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment