blob: 500cfab622c5c06896c3b047cbe573f641caba22 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 5f2c7e50b99d72177250c44236c41b99bfc161b5 Mon Sep 17 00:00:00 2001
2From: Andrej Valek <andrej.valek@siemens.com>
3Date: Thu, 7 Jun 2018 15:21:06 +0200
4Subject: [PATCH 4/6] %% original patch:
5 0004-THRIFT-3207-enable-build-with-OpenSSL-1.1.0-series.patch
6
7---
8 lib/cpp/src/thrift/transport/TSSLSocket.cpp | 6 ++++++
9 1 file changed, 6 insertions(+)
10
11diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
12index 98c5326..3da9e45 100644
13--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
14+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
15@@ -39,6 +39,7 @@
16 #include <thrift/transport/PlatformSocket.h>
17
18 #define OPENSSL_VERSION_NO_THREAD_ID 0x10000000L
19+#define OPENSSL_VERSION_WITH_TLSv1_1_AND_TLSv1_2 0x10100000L
20
21 using namespace std;
22 using namespace apache::thrift::concurrency;
23@@ -143,10 +144,15 @@ SSLContext::SSLContext(const SSLProtocol& protocol) {
24 ctx_ = SSL_CTX_new(SSLv3_method());
25 } else if (protocol == TLSv1_0) {
26 ctx_ = SSL_CTX_new(TLSv1_method());
27+#if (OPENSSL_VERSION_NUMBER >= OPENSSL_VERSION_WITH_TLSv1_1_AND_TLSv1_2)
28 } else if (protocol == TLSv1_1) {
29 ctx_ = SSL_CTX_new(TLSv1_1_method());
30 } else if (protocol == TLSv1_2) {
31 ctx_ = SSL_CTX_new(TLSv1_2_method());
32+#else
33+ //Support for this versions will end on 2016-12-31
34+ //https://www.openssl.org/about/releasestrat.html
35+#endif
36 } else {
37 /// UNKNOWN PROTOCOL!
38 throw TSSLException("SSL_CTX_new: Unknown protocol");
39--
402.19.0
41