|
|
0e3136 |
diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c
|
|
|
0e3136 |
index 979489c..3d6443b 100644
|
|
|
0e3136 |
--- a/modules/ssl/ssl_engine_config.c
|
|
|
0e3136 |
+++ b/modules/ssl/ssl_engine_config.c
|
|
|
0e3136 |
@@ -1485,6 +1485,10 @@ static const char *ssl_cmd_protocol_parse(cmd_parms *parms,
|
|
|
0e3136 |
#endif
|
|
|
0e3136 |
else if (strcEQ(w, "all")) {
|
|
|
0e3136 |
thisopt = SSL_PROTOCOL_ALL;
|
|
|
0e3136 |
+#ifndef OPENSSL_NO_SSL3
|
|
|
0e3136 |
+ /* by default, ALL kw doesn't turn on SSLv3 */
|
|
|
0e3136 |
+ thisopt &= ~SSL_PROTOCOL_SSLV3;
|
|
|
0e3136 |
+#endif
|
|
|
0e3136 |
}
|
|
|
0e3136 |
else {
|
|
|
0e3136 |
return apr_pstrcat(parms->temp_pool,
|
|
|
0e3136 |
diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c
|
|
|
0e3136 |
index b0fcf81..ab6f263 100644
|
|
|
0e3136 |
--- a/modules/ssl/ssl_engine_init.c
|
|
|
0e3136 |
+++ b/modules/ssl/ssl_engine_init.c
|
|
|
0e3136 |
@@ -568,6 +568,28 @@ static apr_status_t ssl_init_ctx_tls_extensions(server_rec *s,
|
|
|
0e3136 |
}
|
|
|
0e3136 |
#endif
|
|
|
0e3136 |
|
|
|
0e3136 |
+/*
|
|
|
0e3136 |
+ * Enable/disable SSLProtocol. If the mod_ssl enables protocol
|
|
|
0e3136 |
+ * which is disabled by default by OpenSSL, show a warning.
|
|
|
0e3136 |
+ * "option" is for example SSL_OP_NO_SSLv3.
|
|
|
0e3136 |
+ */
|
|
|
0e3136 |
+static void ssl_set_ctx_protocol_option(server_rec *s,
|
|
|
0e3136 |
+ SSL_CTX *ctx,
|
|
|
0e3136 |
+ long option,
|
|
|
0e3136 |
+ int enabled,
|
|
|
0e3136 |
+ const char *name)
|
|
|
0e3136 |
+{
|
|
|
0e3136 |
+ if (!enabled) {
|
|
|
0e3136 |
+ SSL_CTX_set_options(ctx, option);
|
|
|
0e3136 |
+ }
|
|
|
0e3136 |
+ else if (SSL_CTX_get_options(ctx) & option) {
|
|
|
0e3136 |
+ SSL_CTX_clear_options(ctx, option);
|
|
|
0e3136 |
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(02904)
|
|
|
0e3136 |
+ "Allowing SSLProtocol %s even though it is disabled "
|
|
|
0e3136 |
+ "by OpenSSL by default on this system", name);
|
|
|
0e3136 |
+ }
|
|
|
0e3136 |
+}
|
|
|
0e3136 |
+
|
|
|
0e3136 |
static apr_status_t ssl_init_ctx_protocol(server_rec *s,
|
|
|
0e3136 |
apr_pool_t *p,
|
|
|
0e3136 |
apr_pool_t *ptemp,
|
|
|
0e3136 |
@@ -735,9 +757,13 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s,
|
|
|
0e3136 |
}
|
|
|
0e3136 |
if (prot == TLS1_1_VERSION && protocol & SSL_PROTOCOL_TLSV1) {
|
|
|
0e3136 |
prot = TLS1_VERSION;
|
|
|
0e3136 |
+ ssl_set_ctx_protocol_option(s, ctx, SSL_OP_NO_TLSv1,
|
|
|
0e3136 |
+ protocol & SSL_PROTOCOL_TLSV1, "TLSv1");
|
|
|
0e3136 |
}
|
|
|
0e3136 |
#ifndef OPENSSL_NO_SSL3
|
|
|
0e3136 |
if (prot == TLS1_VERSION && protocol & SSL_PROTOCOL_SSLV3) {
|
|
|
0e3136 |
+ ssl_set_ctx_protocol_option(s, ctx, SSL_OP_NO_SSLv3,
|
|
|
0e3136 |
+ protocol & SSL_PROTOCOL_SSLV3, "SSLv3");
|
|
|
0e3136 |
prot = SSL3_VERSION;
|
|
|
0e3136 |
}
|
|
|
0e3136 |
#endif
|