Skip to content

Commit 1328415

Browse files
committed
ossl.c: use OPENSSL_init_ssl() and OpenSSL_version() with LibreSSL
LibreSSL 2.7.0 added support for OPENSSL_init_ssl() and OpenSSL_version().
1 parent f33d611 commit 1328415

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/openssl/ossl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ Init_openssl(void)
10501050
/*
10511051
* Init all digests, ciphers
10521052
*/
1053-
#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000
1053+
#if OSSL_OPENSSL_PREREQ(1, 1, 0) || OSSL_IS_LIBRESSL
10541054
if (!OPENSSL_init_ssl(0, NULL))
10551055
rb_raise(rb_eRuntimeError, "OPENSSL_init_ssl");
10561056
#else
@@ -1075,7 +1075,7 @@ Init_openssl(void)
10751075
/*
10761076
* Version of OpenSSL the ruby OpenSSL extension is running with
10771077
*/
1078-
#if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000
1078+
#if OSSL_OPENSSL_PREREQ(1, 1, 0) || OSSL_IS_LIBRESSL
10791079
rb_define_const(mOSSL, "OPENSSL_LIBRARY_VERSION", rb_str_new2(OpenSSL_version(OPENSSL_VERSION)));
10801080
#else
10811081
rb_define_const(mOSSL, "OPENSSL_LIBRARY_VERSION", rb_str_new2(SSLeay_version(SSLEAY_VERSION)));

0 commit comments

Comments
 (0)