mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-19 12:02:52 +00:00
SSL/TLS: fix bogus 'socket closed' error message
When we get there then the ssl handshake has failed, or we could not create a ssl context because ssl library initialization failed on startup. Reflect that in the log message.
This commit is contained in:
parent
defd7e09af
commit
df359835d1
@ -383,9 +383,10 @@ ConnSSL_Init_SSL(CONNECTION *c)
|
|||||||
int ret;
|
int ret;
|
||||||
assert(c != NULL);
|
assert(c != NULL);
|
||||||
#ifdef HAVE_LIBSSL
|
#ifdef HAVE_LIBSSL
|
||||||
if (!ssl_ctx) /* NULL when library initialization failed */
|
if (!ssl_ctx) {
|
||||||
|
Log(LOG_ERR, "Cannot init ssl_ctx: OpenSSL initialization failed at startup");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
assert(c->ssl_state.ssl == NULL);
|
assert(c->ssl_state.ssl == NULL);
|
||||||
|
|
||||||
c->ssl_state.ssl = SSL_new(ssl_ctx);
|
c->ssl_state.ssl = SSL_new(ssl_ctx);
|
||||||
|
@ -342,7 +342,7 @@ cb_clientserver_ssl(int sock, short what)
|
|||||||
case 0:
|
case 0:
|
||||||
return; /* EAGAIN: callback will be invoked again by IO layer */
|
return; /* EAGAIN: callback will be invoked again by IO layer */
|
||||||
default:
|
default:
|
||||||
Conn_Close(idx, "Socket closed!", "SSL accept error", false);
|
Conn_Close(idx, "SSL accept error, closing socket", "SSL accept error", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (what & IO_WANTREAD)
|
if (what & IO_WANTREAD)
|
||||||
|
Loading…
Reference in New Issue
Block a user