Keep old method in case of an unsupported protocol
[openssl.git] / ssl / ssltest.c
index 316bbb0c9582fe962945bd532c93eb3fd93c1d81..4f80be8ee4d8e403c7887b62cba36d92e91bd6b2 100644 (file)
@@ -881,7 +881,13 @@ bad:
                meth=SSLv23_method();
 #else
 #ifdef OPENSSL_NO_SSL2
-       meth=SSLv3_method();
+       if (tls1)
+               meth=TLSv1_method();
+       else
+       if (ssl3)
+               meth=SSLv3_method();
+       else
+               meth=SSLv23_method();
 #else
        meth=SSLv2_method();
 #endif