Skip to content

Commit

Permalink
Allow TLS 1.2 connections when using openssl
Browse files Browse the repository at this point in the history
Adding TLS 1.2 support will allow us to be more future-proof and have
better ciphersuites such as as the use of ECDHE-ECDSA-AES256-GCM-SHA384.
This patch allows tls 1.2. 1.1 and 1.0 while the broken sslv2 and
sslv3 are disabled.

Fixes #440: Allow TLS 1.2 connections when using openssl
  • Loading branch information
cviecco authored and Marco van Wieringen committed May 9, 2015
1 parent 9d89f10 commit fc760fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -22,6 +22,7 @@ Ben Walton
Bernd Frick
Bill Moran
Bruno Friedmann
Camilo Viecco
Carlos A. Molina G
Carsten Paeth
Chris Lee
Expand Down
16 changes: 13 additions & 3 deletions src/lib/tls_openssl.c
Expand Up @@ -390,15 +390,25 @@ TLS_CONTEXT *new_tls_context(const char *ca_certfile,
ctx = (TLS_CONTEXT *)malloc(sizeof(TLS_CONTEXT));

/*
* Allocate our OpenSSL TLSv1 Context
* Allocate our OpenSSL Context
* We allow tls 1.2. 1.1 and 1.0
*/
ctx->openssl = SSL_CTX_new(TLSv1_method());

ctx->openssl = SSL_CTX_new(SSLv23_method());
if (!ctx->openssl) {
openssl_post_errors(M_FATAL, _("Error initializing SSL context"));
goto err;
}

/*
* Enable all Bug Workarounds
*/
SSL_CTX_set_options(ctx->openssl, SSL_OP_ALL);

/*
* Disallow broken sslv2 and sslv3.
*/
SSL_CTX_set_options(ctx->openssl, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);

/*
* Set up pem encryption callback
*/
Expand Down

0 comments on commit fc760fc

Please sign in to comment.