The patch saves one EC_KEY_generate_key() call per server{} block by
informing OpenSSL about SSL_OP_SINGLE_ECDH_USE we are going to use before
the SSL_CTX_set_tmp_ecdh() call.
For a configuration file with 10k simple server{} blocks with SSL enabled
this change reduces startup time from 18s to 5s on a slow test box here.
return NGX_ERROR;
}
- SSL_CTX_set_tmp_ecdh(ssl->ctx, ecdh);
-
SSL_CTX_set_options(ssl->ctx, SSL_OP_SINGLE_ECDH_USE);
+ SSL_CTX_set_tmp_ecdh(ssl->ctx, ecdh);
+
EC_KEY_free(ecdh);
#endif
#endif