Skip to content

Commit

Permalink
BUILD: ssl: Allow building against libssl without SSLv3.
Browse files Browse the repository at this point in the history
If SSLv3 is explicitely requested but not available, warn the user and
bail out.
  • Loading branch information
jcourreges authored and wtarreau committed Jul 26, 2015
1 parent e192cbb commit 17c3f62
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/ssl_sock.c
Expand Up @@ -1937,8 +1937,14 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, SSL_CTX *ctx, struct proxy
ssloptions |= SSL_OP_NO_TLSv1_2; ssloptions |= SSL_OP_NO_TLSv1_2;
if (bind_conf->ssl_options & BC_SSL_O_NO_TLS_TICKETS) if (bind_conf->ssl_options & BC_SSL_O_NO_TLS_TICKETS)
ssloptions |= SSL_OP_NO_TICKET; ssloptions |= SSL_OP_NO_TICKET;
if (bind_conf->ssl_options & BC_SSL_O_USE_SSLV3) if (bind_conf->ssl_options & BC_SSL_O_USE_SSLV3) {
#ifndef OPENSSL_NO_SSL3
SSL_CTX_set_ssl_version(ctx, SSLv3_server_method()); SSL_CTX_set_ssl_version(ctx, SSLv3_server_method());
#else
Alert("SSLv3 support requested but unavailable.\n");
cfgerr++;
#endif
}
if (bind_conf->ssl_options & BC_SSL_O_USE_TLSV10) if (bind_conf->ssl_options & BC_SSL_O_USE_TLSV10)
SSL_CTX_set_ssl_version(ctx, TLSv1_server_method()); SSL_CTX_set_ssl_version(ctx, TLSv1_server_method());
#if SSL_OP_NO_TLSv1_1 #if SSL_OP_NO_TLSv1_1
Expand Down Expand Up @@ -2305,8 +2311,14 @@ int ssl_sock_prepare_srv_ctx(struct server *srv, struct proxy *curproxy)
options |= SSL_OP_NO_TLSv1_2; options |= SSL_OP_NO_TLSv1_2;
if (srv->ssl_ctx.options & SRV_SSL_O_NO_TLS_TICKETS) if (srv->ssl_ctx.options & SRV_SSL_O_NO_TLS_TICKETS)
options |= SSL_OP_NO_TICKET; options |= SSL_OP_NO_TICKET;
if (srv->ssl_ctx.options & SRV_SSL_O_USE_SSLV3) if (srv->ssl_ctx.options & SRV_SSL_O_USE_SSLV3) {
#ifndef OPENSSL_NO_SSL3
SSL_CTX_set_ssl_version(srv->ssl_ctx.ctx, SSLv3_client_method()); SSL_CTX_set_ssl_version(srv->ssl_ctx.ctx, SSLv3_client_method());
#else
Alert("SSLv3 support requested but unavailable.");
cfgerr++;
#endif
}
if (srv->ssl_ctx.options & SRV_SSL_O_USE_TLSV10) if (srv->ssl_ctx.options & SRV_SSL_O_USE_TLSV10)
SSL_CTX_set_ssl_version(srv->ssl_ctx.ctx, TLSv1_client_method()); SSL_CTX_set_ssl_version(srv->ssl_ctx.ctx, TLSv1_client_method());
#if SSL_OP_NO_TLSv1_1 #if SSL_OP_NO_TLSv1_1
Expand Down

0 comments on commit 17c3f62

Please sign in to comment.