Skip to content

Commit 58df6a3

Browse files
committed
Do not explicitly initialize and clean up OpenSSL for OpenSSL 1.1
1 parent 752fc86 commit 58df6a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/openssl/openssl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,7 @@ PHP_MINIT_FUNCTION(openssl)
14151415
le_x509 = zend_register_list_destructors_ex(php_openssl_x509_free, NULL, "OpenSSL X.509", module_number);
14161416
le_csr = zend_register_list_destructors_ex(php_openssl_csr_free, NULL, "OpenSSL X.509 CSR", module_number);
14171417

1418+
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
14181419
SSL_library_init();
14191420
OpenSSL_add_all_ciphers();
14201421
OpenSSL_add_all_digests();
@@ -1427,6 +1428,7 @@ PHP_MINIT_FUNCTION(openssl)
14271428
#endif
14281429

14291430
SSL_load_error_strings();
1431+
#endif
14301432

14311433
/* register a resource id number with OpenSSL so that we can map SSL -> stream structures in
14321434
* OpenSSL callbacks */
@@ -1591,12 +1593,14 @@ PHP_MINFO_FUNCTION(openssl)
15911593
*/
15921594
PHP_MSHUTDOWN_FUNCTION(openssl)
15931595
{
1596+
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
15941597
EVP_cleanup();
15951598

15961599
/* prevent accessing locking callback from unloaded extension */
15971600
CRYPTO_set_locking_callback(NULL);
15981601
/* free allocated error strings */
15991602
ERR_free_strings();
1603+
#endif
16001604

16011605
php_unregister_url_stream_wrapper("https");
16021606
php_unregister_url_stream_wrapper("ftps");

0 commit comments

Comments
 (0)