comparison src/event/ngx_event_openssl.c @ 6488:a57b2b8999e7

SSL: initialization changes for OpenSSL 1.1.0. OPENSSL_config() deprecated in OpenSSL 1.1.0. Additionally, SSL_library_init(), SSL_load_error_strings() and OpenSSL_add_all_algorithms() are no longer available if OPENSSL_API_COMPAT is set to 0x10100000L. The OPENSSL_init_ssl() function is now used instead with appropriate arguments to trigger the same behaviour. The configure test changed to use SSL_CTX_set_options(). Deinitialization now happens automatically in OPENSSL_cleanup() called via atexit(3), so we no longer call EVP_cleanup() and ENGINE_cleanup() directly.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 31 Mar 2016 23:38:33 +0300
parents 9dd43f4ef67e
children c256dfdd469d
comparison
equal deleted inserted replaced
6487:9dd43f4ef67e 6488:a57b2b8999e7
109 109
110 110
111 ngx_int_t 111 ngx_int_t
112 ngx_ssl_init(ngx_log_t *log) 112 ngx_ssl_init(ngx_log_t *log)
113 { 113 {
114 #if OPENSSL_VERSION_NUMBER >= 0x10100003L
115
116 OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL);
117
118 #else
119
114 #ifndef OPENSSL_IS_BORINGSSL 120 #ifndef OPENSSL_IS_BORINGSSL
115 OPENSSL_config(NULL); 121 OPENSSL_config(NULL);
116 #endif 122 #endif
117 123
118 SSL_library_init(); 124 SSL_library_init();
119 SSL_load_error_strings(); 125 SSL_load_error_strings();
120 126
121 OpenSSL_add_all_algorithms(); 127 OpenSSL_add_all_algorithms();
128
129 #endif
122 130
123 #if OPENSSL_VERSION_NUMBER >= 0x0090800fL 131 #if OPENSSL_VERSION_NUMBER >= 0x0090800fL
124 #ifndef SSL_OP_NO_COMPRESSION 132 #ifndef SSL_OP_NO_COMPRESSION
125 { 133 {
126 /* 134 /*
3546 3554
3547 3555
3548 static void 3556 static void
3549 ngx_openssl_exit(ngx_cycle_t *cycle) 3557 ngx_openssl_exit(ngx_cycle_t *cycle)
3550 { 3558 {
3559 #if OPENSSL_VERSION_NUMBER < 0x10100003L
3560
3551 EVP_cleanup(); 3561 EVP_cleanup();
3552 #ifndef OPENSSL_NO_ENGINE 3562 #ifndef OPENSSL_NO_ENGINE
3553 ENGINE_cleanup(); 3563 ENGINE_cleanup();
3554 #endif 3564 #endif
3555 } 3565
3566 #endif
3567 }