mirror of
https://github.com/osmarks/ngircd.git
synced 2025-06-21 07:44:09 +00:00
Reuse old SSL key if loading a new one failed
This commit is contained in:
parent
c411643d45
commit
e7cb9b1a00
@ -311,8 +311,18 @@ ConnSSL_InitLibrary( void )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ConnSSL_LoadServerKey_openssl(newctx))
|
if (!ConnSSL_LoadServerKey_openssl(newctx)) {
|
||||||
|
/* Failed to read new key but an old ssl context
|
||||||
|
* already exists -> reuse old context */
|
||||||
|
if (ssl_ctx) {
|
||||||
|
SSL_CTX_free(newctx);
|
||||||
|
Log(LOG_WARNING,
|
||||||
|
"Re-Initializing of SSL failed, using old keys!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/* No preexisting old context -> error. */
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (SSL_CTX_set_cipher_list(newctx, Conf_SSLOptions.CipherList) == 0) {
|
if (SSL_CTX_set_cipher_list(newctx, Conf_SSLOptions.CipherList) == 0) {
|
||||||
Log(LOG_ERR, "Failed to apply OpenSSL cipher list \"%s\"!",
|
Log(LOG_ERR, "Failed to apply OpenSSL cipher list \"%s\"!",
|
||||||
|
@ -132,7 +132,7 @@ Rehash(void)
|
|||||||
|
|
||||||
if (!ConnSSL_InitLibrary())
|
if (!ConnSSL_InitLibrary())
|
||||||
Log(LOG_WARNING,
|
Log(LOG_WARNING,
|
||||||
"Re-Initializing of SSL failed, using old keys!");
|
"Re-Initializing of SSL failed!");
|
||||||
|
|
||||||
/* Start listening on sockets */
|
/* Start listening on sockets */
|
||||||
Conn_InitListeners( );
|
Conn_InitListeners( );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user