7ae6f15
diff --git a/CryptoPkg/Library/OpensslLib/openssl/ssl/ssl_lib.c b/CryptoPkg/Library/OpensslLib/openssl/ssl/ssl_lib.c
7ae6f15
index 8a190d2..6b4c5ae 100644
7ae6f15
--- a/CryptoPkg/Library/OpensslLib/openssl/ssl/ssl_lib.c
7ae6f15
+++ b/CryptoPkg/Library/OpensslLib/openssl/ssl/ssl_lib.c
7ae6f15
@@ -2653,6 +2653,13 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
91c79aa
      * or by using the SSL_CONF library.
91c79aa
      */
91c79aa
     ret->options |= SSL_OP_NO_COMPRESSION;
91c79aa
+    /*
91c79aa
+     * Disable SSLv3 by default.  Applications can
91c79aa
+     * re-enable it by configuring
91c79aa
+     * SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv3);
91c79aa
+     * or by using the SSL_CONF library.
91c79aa
+     */
91c79aa
+    ret->options |= SSL_OP_NO_SSLv3;
91c79aa
 
91c79aa
     ret->tlsext_status_type = -1;
91c79aa
 
7ae6f15
diff --git a/CryptoPkg/Library/OpensslLib/openssl/test/ssl_test.c b/CryptoPkg/Library/OpensslLib/openssl/test/ssl_test.c
7ae6f15
index 2cbbddd..1a409d1 100644
7ae6f15
--- a/CryptoPkg/Library/OpensslLib/openssl/test/ssl_test.c
7ae6f15
+++ b/CryptoPkg/Library/OpensslLib/openssl/test/ssl_test.c
7ae6f15
@@ -277,6 +277,7 @@ static int execute_test(SSL_TEST_FIXTURE fixture)
91c79aa
             SSL_TEST_SERVERNAME_CB_NONE) {
91c79aa
             server2_ctx = SSL_CTX_new(TLS_server_method());
91c79aa
             TEST_check(server2_ctx != NULL);
91c79aa
+            SSL_CTX_clear_options(server2_ctx, SSL_OP_NO_SSLv3);
91c79aa
         }
91c79aa
         client_ctx = SSL_CTX_new(TLS_client_method());
7ae6f15
         TEST_check(SSL_CTX_set_max_proto_version(client_ctx, TLS_MAX_VERSION));
7ae6f15
@@ -290,11 +291,15 @@ static int execute_test(SSL_TEST_FIXTURE fixture)
7ae6f15
                                                      TLS_MAX_VERSION));
91c79aa
             TEST_check(resume_server_ctx != NULL);
91c79aa
             TEST_check(resume_client_ctx != NULL);
91c79aa
+            SSL_CTX_clear_options(resume_server_ctx, SSL_OP_NO_SSLv3);
91c79aa
+            SSL_CTX_clear_options(resume_client_ctx, SSL_OP_NO_SSLv3);
91c79aa
         }
91c79aa
     }
91c79aa
 
91c79aa
     TEST_check(server_ctx != NULL);
91c79aa
     TEST_check(client_ctx != NULL);
91c79aa
+    SSL_CTX_clear_options(server_ctx, SSL_OP_NO_SSLv3);
91c79aa
+    SSL_CTX_clear_options(client_ctx, SSL_OP_NO_SSLv3);
91c79aa
 
91c79aa
     TEST_check(CONF_modules_load(conf, fixture.test_app, 0) > 0);
91c79aa
 
7ae6f15
diff --git a/CryptoPkg/Library/OpensslLib/openssl/test/ssltest_old.c b/CryptoPkg/Library/OpensslLib/openssl/test/ssltest_old.c
7ae6f15
index e77c692..e586072 100644
7ae6f15
--- a/CryptoPkg/Library/OpensslLib/openssl/test/ssltest_old.c
7ae6f15
+++ b/CryptoPkg/Library/OpensslLib/openssl/test/ssltest_old.c
7ae6f15
@@ -1460,6 +1460,11 @@ int main(int argc, char *argv[])
91c79aa
         ERR_print_errors(bio_err);
91c79aa
         goto end;
91c79aa
     }
91c79aa
+
91c79aa
+    SSL_CTX_clear_options(c_ctx, SSL_OP_NO_SSLv3);
91c79aa
+    SSL_CTX_clear_options(s_ctx, SSL_OP_NO_SSLv3);
91c79aa
+    SSL_CTX_clear_options(s_ctx2, SSL_OP_NO_SSLv3);
91c79aa
+
91c79aa
     /*
91c79aa
      * Since we will use low security ciphersuites and keys for testing set
91c79aa
      * security level to zero by default. Tests can override this by adding
7ae6f15
-- 
7ae6f15
2.17.0
7ae6f15