Blame SOURCES/httpd-2.4.37-sslprotdefault.patch

e71654
diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c
e71654
index 55c237e..5467d23 100644
e71654
--- a/modules/ssl/ssl_engine_config.c
e71654
+++ b/modules/ssl/ssl_engine_config.c
e71654
@@ -119,7 +119,7 @@ static void modssl_ctx_init(modssl_ctx_t *mctx, apr_pool_t *p)
e71654
     mctx->ticket_key          = NULL;
e71654
 #endif
e71654
 
e71654
-    mctx->protocol            = SSL_PROTOCOL_DEFAULT;
e71654
+    mctx->protocol            = SSL_PROTOCOL_NONE;
e71654
     mctx->protocol_set        = 0;
e71654
 
e71654
     mctx->pphrase_dialog_type = SSL_PPTYPE_UNSET;
e71654
@@ -262,6 +262,7 @@ static void modssl_ctx_cfg_merge(apr_pool_t *p,
e71654
 {
e71654
     if (add->protocol_set) {
e71654
         mrg->protocol = add->protocol;
e71654
+        mrg->protocol_set = 1;
e71654
     }
e71654
     else {
e71654
         mrg->protocol = base->protocol;
e71654
diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
e71654
index e3f62fe..31fc0e6 100644
e71654
--- a/modules/ssl/ssl_engine_init.c
e71654
+++ b/modules/ssl/ssl_engine_init.c
e71654
@@ -568,6 +568,7 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
e71654
     MODSSL_SSL_METHOD_CONST SSL_METHOD *method = NULL;
e71654
     char *cp;
e71654
     int protocol = mctx->protocol;
e71654
+    int protocol_set = mctx->protocol_set;
e71654
     SSLSrvConfigRec *sc = mySrvConfig(s);
e71654
 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
e71654
     int prot;
e71654
@@ -577,12 +578,18 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
e71654
      *  Create the new per-server SSL context
e71654
      */
e71654
     if (protocol == SSL_PROTOCOL_NONE) {
e71654
-        ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02231)
e71654
-                "No SSL protocols available [hint: SSLProtocol]");
e71654
-        return ssl_die(s);
e71654
-    }
e71654
+        if (protocol_set) {
e71654
+            ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02231)
e71654
+                    "No SSL protocols available [hint: SSLProtocol]");
e71654
+            return ssl_die(s);
e71654
+        }
e71654
 
e71654
-    cp = apr_pstrcat(p,
e71654
+        ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s, 
e71654
+                     "Using OpenSSL/system default SSL/TLS protocols");
e71654
+        cp = "default";
e71654
+    }
e71654
+    else {
e71654
+        cp = apr_pstrcat(p,
e71654
 #ifndef OPENSSL_NO_SSL3
e71654
                      (protocol & SSL_PROTOCOL_SSLV3 ? "SSLv3, " : ""),
e71654
 #endif
e71654
@@ -595,7 +602,8 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
e71654
 #endif
e71654
 #endif
e71654
                      NULL);
e71654
-    cp[strlen(cp)-2] = NUL;
e71654
+        cp[strlen(cp)-2] = NUL;
e71654
+    }
e71654
 
e71654
     ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
e71654
                  "Creating new SSL context (protocols: %s)", cp);
e71654
@@ -696,13 +704,15 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
e71654
         prot = SSL3_VERSION;
e71654
 #endif
e71654
     } else {
e71654
-        SSL_CTX_free(ctx);
e71654
-        mctx->ssl_ctx = NULL;
e71654
-        ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03378)
e71654
-                "No SSL protocols available [hint: SSLProtocol]");
e71654
-        return ssl_die(s);
e71654
+        if (protocol_set) {
e71654
+            SSL_CTX_free(ctx);
e71654
+            mctx->ssl_ctx = NULL;
e71654
+            ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(03378)
e71654
+                    "No SSL protocols available [hint: SSLProtocol]");
e71654
+            return ssl_die(s);
e71654
+        }
e71654
     }
e71654
-    SSL_CTX_set_max_proto_version(ctx, prot);
e71654
+    if (protocol != SSL_PROTOCOL_NONE) SSL_CTX_set_max_proto_version(ctx, prot);
e71654
 
e71654
     /* Next we scan for the minimal protocol version we should provide,
e71654
      * but we do not allow holes between max and min */
e71654
@@ -726,7 +736,7 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
e71654
         prot = SSL3_VERSION;
e71654
     }
e71654
 #endif
e71654
-    SSL_CTX_set_min_proto_version(ctx, prot);
e71654
+    if (protocol != SSL_PROTOCOL_NONE) SSL_CTX_set_min_proto_version(ctx, prot);
e71654
 #endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L */
e71654
 
e71654
 #ifdef SSL_OP_CIPHER_SERVER_PREFERENCE