aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/event/ngx_event_openssl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 3c74b7b21..8c7c67704 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -121,7 +121,17 @@ ngx_ssl_init(ngx_log_t *log)
{
#if OPENSSL_VERSION_NUMBER >= 0x10100003L
- OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL);
+ if (OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL) == 0) {
+ ngx_ssl_error(NGX_LOG_ALERT, log, 0, "OPENSSL_init_ssl() failed");
+ return NGX_ERROR;
+ }
+
+ /*
+ * OPENSSL_init_ssl() may leave errors in the error queue
+ * while returning success
+ */
+
+ ERR_clear_error();
#else