Pay attention to disabled SSL versions.
authorRichard Levitte <levitte@openssl.org>
Fri, 14 Feb 2003 05:24:25 +0000 (05:24 +0000)
committerRichard Levitte <levitte@openssl.org>
Fri, 14 Feb 2003 05:24:25 +0000 (05:24 +0000)
PR: 500

apps/ocsp.c

index 6182410f6ad740b903e1e1f28dc84b5e7a8d3e63..f05ec0e65540dffa0c32cc4f83189ee7e0e32a40 100644 (file)
@@ -738,7 +738,16 @@ int MAIN(int argc, char **argv)
                if (use_ssl == 1)
                        {
                        BIO *sbio;
+#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
                        ctx = SSL_CTX_new(SSLv23_client_method());
+#elif !defined(OPENSSL_NO_SSL3)
+                       ctx = SSL_CTX_new(SSLv3_client_method());
+#elif !defined(OPENSSL_NO_SSL2)
+                       ctx = SSL_CTX_new(SSLv2_client_method());
+#else
+                       BIO_printf(bio_err, "SSL is disabled\n");
+                       goto end;
+#endif
                        SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
                        sbio = BIO_new_ssl(ctx, 1);
                        cbio = BIO_push(sbio, cbio);