Partial workaround for PR#2771.
[openssl.git] / ssl / s3_pkt.c
index ca5412dc2a4c15dfc7e0baf8f0986b8fd6c2a00c..2d569cc1cedc5aa2bb0d0e7f876a22468e77950e 100644 (file)
@@ -740,7 +740,14 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
        wr->type=type;
 
        *(p++)=(s->version>>8);
-       *(p++)=s->version&0xff;
+       /* Some servers hang if iniatial client hello is larger than 256
+        * bytes and record version number > TLS 1.0
+        */
+       if (s->state == SSL3_ST_CW_CLNT_HELLO_B
+                               && TLS1_get_version(s) > TLS1_VERSION)
+               *(p++) = 0x1;
+       else
+               *(p++)=s->version&0xff;
 
        /* field where we are to write out packet length */
        plen=p;