Skip to content

Commit 023696b

Browse files
committed
ssl: prefer TLS_method() over SSLv23_method()
OpenSSL 1.1.0 replaced SSLv23_method() with TLS_method(). SSLv23_method which still exists in 1.1.0, as a macro around TLS_method, will eventually be removed. Use the new name if possible.
1 parent 8d93f53 commit 023696b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/openssl/ossl_ssl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ ossl_sslctx_s_alloc(VALUE klass)
121121
VALUE obj;
122122

123123
obj = TypedData_Wrap_Struct(klass, &ossl_sslctx_type, 0);
124+
#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
125+
ctx = SSL_CTX_new(TLS_method());
126+
#else
124127
ctx = SSL_CTX_new(SSLv23_method());
128+
#endif
125129
if (!ctx) {
126130
ossl_raise(eSSLError, "SSL_CTX_new");
127131
}

0 commit comments

Comments
 (0)