summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2020-08-06 15:35:30 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-07-18 17:44:43 +0900
commit88d64418ddb77118b17c20a1455aa0c6341e077a (patch)
treea8f49a26a777f987730ee11c1a0218c1e8ac4734 /ext/openssl
parent50332c40710ab421318c97be0c6ca94b71d4fe58 (diff)
[ruby/openssl] ssl: use TLS_method() instead of SSLv23_method() for LibreSSL
LibreSSL 2.2.2 introduced TLS_method(), but with different semantics from OpenSSL: TLS_method() enabled TLS >= 1.0 while SSLv23_method() enabled all available versions, which included SSL 3.0 in addition. However, LibreSSL 2.3.0 removed SSL 3.0 support completely and now TLS_method() and SSLv23_method() are equivalent. https://github.com/ruby/openssl/commit/3b7d7045b8
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/ossl_ssl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index e8fb13f7ea..e3f3848587 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -81,7 +81,7 @@ ossl_sslctx_s_alloc(VALUE klass)
VALUE obj;
obj = TypedData_Wrap_Struct(klass, &ossl_sslctx_type, 0);
-#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER >= 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
ctx = SSL_CTX_new(TLS_method());
#else
ctx = SSL_CTX_new(SSLv23_method());