summaryrefslogtreecommitdiffstats
path: root/network/emailrelay/patches/b79f2cb7c70d7c311162cb9d38b3921b76ddae3d.patch
blob: 3e0f6f2115ff0d601f7f03b9a2109c7a1426f2a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From b79f2cb7c70d7c311162cb9d38b3921b76ddae3d Mon Sep 17 00:00:00 2001
From: Andrew Clemons <andrew.clemons@gmail.com>
Date: Thu, 5 May 2016 12:55:02 +1200
Subject: [PATCH] Use TLS1.1 and TLS1.2 if openssl supports it

---
 src/gssl/gssl_openssl.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gssl/gssl_openssl.cpp b/src/gssl/gssl_openssl.cpp
index 34af44f..f64ad94 100644
--- a/src/gssl/gssl_openssl.cpp
+++ b/src/gssl/gssl_openssl.cpp
@@ -294,8 +294,10 @@ GSsl::Context::Context( const std::string & pem_file , unsigned int flags )
 		m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
 	else if( (flags&3U) == 3U )
 		m_ssl_ctx = SSL_CTX_new(SSLv3_method()) ;
-	else
-		m_ssl_ctx = SSL_CTX_new(TLSv1_method()) ;
+	else {
+		m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
+		SSL_CTX_set_options(m_ssl_ctx, SSL_OP_NO_SSLv2| SSL_OP_NO_SSLv3) ;
+	}
 
 	if( m_ssl_ctx == NULL )
 		throw Error( "SSL_CTX_new" , ERR_get_error() ) ;