Do not bother initializing OpenSSL if only listening locally

This commit is contained in:
Pierre Pronchery 2012-09-22 20:54:07 +00:00
parent bcec18dfc9
commit 7f8c7de6ba

View File

@ -509,12 +509,15 @@ AppServer * appserver_new_event(char const * app, int options, Event * event)
# ifdef DEBUG
fprintf(stderr, "DEBUG: Using certificate \"%s\"\n", crt);
# endif
if(!(options & ASO_LOCAL))
if((appserver->ssl_ctx = SSL_CTX_new(SSLv3_server_method())) == NULL
|| SSL_CTX_set_cipher_list(appserver->ssl_ctx,
SSL_DEFAULT_CIPHER_LIST) != 1
|| SSL_CTX_use_certificate_file(appserver->ssl_ctx, crt,
|| SSL_CTX_use_certificate_file(
appserver->ssl_ctx, crt,
SSL_FILETYPE_PEM) == 0
|| SSL_CTX_use_PrivateKey_file(appserver->ssl_ctx, crt,
|| SSL_CTX_use_PrivateKey_file(
appserver->ssl_ctx, crt,
SSL_FILETYPE_PEM) == 0)
{
error_set_code(1, "%s", _appserver_error_ssl());