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