6eb8f62
diff -up openssl-1.1.0h/apps/s_client.c.disable-ssl3 openssl-1.1.0h/apps/s_client.c
6eb8f62
--- openssl-1.1.0h/apps/s_client.c.disable-ssl3	2018-03-29 14:38:39.612133765 +0200
6eb8f62
+++ openssl-1.1.0h/apps/s_client.c	2018-03-29 14:41:51.309635904 +0200
6eb8f62
@@ -1489,6 +1489,9 @@ int s_client_main(int argc, char **argv)
6eb8f62
     if (!config_ctx(cctx, ssl_args, ctx))
6eb8f62
         goto end;
790567d
 
790567d
+    if (min_version == SSL3_VERSION && max_version == SSL3_VERSION)
790567d
+        SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv3);
790567d
+
790567d
     if (ssl_config) {
790567d
         if (SSL_CTX_config(ctx, ssl_config) == 0) {
790567d
             BIO_printf(bio_err, "Error using configuration \"%s\"\n",
6eb8f62
diff -up openssl-1.1.0h/apps/s_server.c.disable-ssl3 openssl-1.1.0h/apps/s_server.c
6eb8f62
--- openssl-1.1.0h/apps/s_server.c.disable-ssl3	2018-03-29 14:38:39.613133788 +0200
6eb8f62
+++ openssl-1.1.0h/apps/s_server.c	2018-03-29 14:42:27.313481477 +0200
6eb8f62
@@ -1619,6 +1619,9 @@ int s_server_main(int argc, char *argv[]
6eb8f62
     if (!config_ctx(cctx, ssl_args, ctx))
6eb8f62
         goto end;
6eb8f62
 
790567d
+    if (min_version == SSL3_VERSION && max_version == SSL3_VERSION)
790567d
+        SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv3);
790567d
+
790567d
     if (ssl_config) {
790567d
         if (SSL_CTX_config(ctx, ssl_config) == 0) {
790567d
             BIO_printf(bio_err, "Error using configuration \"%s\"\n",
6eb8f62
diff -up openssl-1.1.0h/ssl/ssl_lib.c.disable-ssl3 openssl-1.1.0h/ssl/ssl_lib.c
6eb8f62
--- openssl-1.1.0h/ssl/ssl_lib.c.disable-ssl3	2018-03-27 15:50:40.000000000 +0200
6eb8f62
+++ openssl-1.1.0h/ssl/ssl_lib.c	2018-03-29 14:38:39.614133811 +0200
6eb8f62
@@ -2653,6 +2653,13 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *m
510bcc2
      * or by using the SSL_CONF library.
510bcc2
      */
510bcc2
     ret->options |= SSL_OP_NO_COMPRESSION;
510bcc2
+    /*
510bcc2
+     * Disable SSLv3 by default.  Applications can
510bcc2
+     * re-enable it by configuring
510bcc2
+     * SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv3);
510bcc2
+     * or by using the SSL_CONF library.
510bcc2
+     */
510bcc2
+    ret->options |= SSL_OP_NO_SSLv3;
510bcc2
 
510bcc2
     ret->tlsext_status_type = -1;
510bcc2
 
6eb8f62
diff -up openssl-1.1.0h/test/ssl_test.c.disable-ssl3 openssl-1.1.0h/test/ssl_test.c
6eb8f62
--- openssl-1.1.0h/test/ssl_test.c.disable-ssl3	2018-03-29 14:38:39.615133835 +0200
6eb8f62
+++ openssl-1.1.0h/test/ssl_test.c	2018-03-29 14:43:37.893139086 +0200
6eb8f62
@@ -277,6 +277,7 @@ static int execute_test(SSL_TEST_FIXTURE
510bcc2
             SSL_TEST_SERVERNAME_CB_NONE) {
510bcc2
             server2_ctx = SSL_CTX_new(TLS_server_method());
510bcc2
             TEST_check(server2_ctx != NULL);
510bcc2
+            SSL_CTX_clear_options(server2_ctx, SSL_OP_NO_SSLv3);
510bcc2
         }
510bcc2
         client_ctx = SSL_CTX_new(TLS_client_method());
6eb8f62
         TEST_check(SSL_CTX_set_max_proto_version(client_ctx, TLS_MAX_VERSION));
6eb8f62
@@ -290,11 +291,15 @@ static int execute_test(SSL_TEST_FIXTURE
6eb8f62
                                                      TLS_MAX_VERSION));
510bcc2
             TEST_check(resume_server_ctx != NULL);
510bcc2
             TEST_check(resume_client_ctx != NULL);
510bcc2
+            SSL_CTX_clear_options(resume_server_ctx, SSL_OP_NO_SSLv3);
510bcc2
+            SSL_CTX_clear_options(resume_client_ctx, SSL_OP_NO_SSLv3);
510bcc2
         }
510bcc2
     }
510bcc2
 
510bcc2
     TEST_check(server_ctx != NULL);
510bcc2
     TEST_check(client_ctx != NULL);
510bcc2
+    SSL_CTX_clear_options(server_ctx, SSL_OP_NO_SSLv3);
510bcc2
+    SSL_CTX_clear_options(client_ctx, SSL_OP_NO_SSLv3);
510bcc2
 
510bcc2
     TEST_check(CONF_modules_load(conf, fixture.test_app, 0) > 0);
510bcc2
 
6eb8f62
diff -up openssl-1.1.0h/test/ssltest_old.c.disable-ssl3 openssl-1.1.0h/test/ssltest_old.c
6eb8f62
--- openssl-1.1.0h/test/ssltest_old.c.disable-ssl3	2018-03-27 15:50:41.000000000 +0200
6eb8f62
+++ openssl-1.1.0h/test/ssltest_old.c	2018-03-29 14:38:39.615133835 +0200
6eb8f62
@@ -1460,6 +1460,11 @@ int main(int argc, char *argv[])
510bcc2
         ERR_print_errors(bio_err);
510bcc2
         goto end;
510bcc2
     }
510bcc2
+
510bcc2
+    SSL_CTX_clear_options(c_ctx, SSL_OP_NO_SSLv3);
510bcc2
+    SSL_CTX_clear_options(s_ctx, SSL_OP_NO_SSLv3);
510bcc2
+    SSL_CTX_clear_options(s_ctx2, SSL_OP_NO_SSLv3);
510bcc2
+
510bcc2
     /*
510bcc2
      * Since we will use low security ciphersuites and keys for testing set
510bcc2
      * security level to zero by default. Tests can override this by adding