diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2017-08-28 22:14:17 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2017-09-02 18:51:00 +0900 |
commit | 5b753d44a917bbc0f2399eaa9aa11702ee69f4db (patch) | |
tree | b8f9bd2869d4a5c8ec0db2cc7631b891bdd8eca1 /ext/openssl/ossl_ssl.c | |
parent | b44ab7f7e7e1c5f0cf618a347579d090b390103d (diff) | |
download | ruby-openssl-5b753d44a917bbc0f2399eaa9aa11702ee69f4db.tar.gz |
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.
Diffstat (limited to 'ext/openssl/ossl_ssl.c')
-rw-r--r-- | ext/openssl/ossl_ssl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index f09430ef..974d7839 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -121,7 +121,11 @@ 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) + ctx = SSL_CTX_new(TLS_method()); +#else ctx = SSL_CTX_new(SSLv23_method()); +#endif if (!ctx) { ossl_raise(eSSLError, "SSL_CTX_new"); } |