Skip to content

Commit 3b7d704

Browse files
committed
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.
1 parent 2ae8f21 commit 3b7d704

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/openssl/ossl_ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ ossl_sslctx_s_alloc(VALUE klass)
8181
VALUE obj;
8282

8383
obj = TypedData_Wrap_Struct(klass, &ossl_sslctx_type, 0);
84-
#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
84+
#if OPENSSL_VERSION_NUMBER >= 0x10100000 || defined(LIBRESSL_VERSION_NUMBER)
8585
ctx = SSL_CTX_new(TLS_method());
8686
#else
8787
ctx = SSL_CTX_new(SSLv23_method());

0 commit comments

Comments
 (0)