]> git.kaiwu.me - nginx.git/commitdiff
SSL: avoid SSL_CTX_set_tmp_rsa_callback() call with LibreSSL.
authorMaxim Dounin <mdounin@mdounin.ru>
Sun, 22 Mar 2015 23:42:34 +0000 (02:42 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Sun, 22 Mar 2015 23:42:34 +0000 (02:42 +0300)
LibreSSL removed support for export ciphers and a call to
SSL_CTX_set_tmp_rsa_callback() results in an error left in the error
queue.  This caused alerts "ignoring stale global SSL error (...called
a function you should not call) while SSL handshaking" on a first connection
in each worker process.

src/http/modules/ngx_http_ssl_module.c
src/mail/ngx_mail_ssl_module.c

index 4c69091d60acf95f1b3442dd494508bec276e816..275febe65a2af2c3ac707c5b985a36df6911b53b 100644 (file)
@@ -715,8 +715,10 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
         SSL_CTX_set_options(conf->ssl.ctx, SSL_OP_CIPHER_SERVER_PREFERENCE);
     }
 
+#ifndef LIBRESSL_VERSION_NUMBER
     /* a temporary 512-bit RSA key is required for export versions of MSIE */
     SSL_CTX_set_tmp_rsa_callback(conf->ssl.ctx, ngx_ssl_rsa512_key_callback);
+#endif
 
     if (ngx_ssl_dhparam(cf, &conf->ssl, &conf->dhparam) != NGX_OK) {
         return NGX_CONF_ERROR;
index 7dc642a6c58812103b59bb4f9064fb60e71f9163..e1efb61d62be035ddbefee90baac75feec4f1329 100644 (file)
@@ -421,7 +421,9 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
         SSL_CTX_set_options(conf->ssl.ctx, SSL_OP_CIPHER_SERVER_PREFERENCE);
     }
 
+#ifndef LIBRESSL_VERSION_NUMBER
     SSL_CTX_set_tmp_rsa_callback(conf->ssl.ctx, ngx_ssl_rsa512_key_callback);
+#endif
 
     if (ngx_ssl_dhparam(cf, &conf->ssl, &conf->dhparam) != NGX_OK) {
         return NGX_CONF_ERROR;