about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2010-05-07 23:25:59 +0200
committerFlorian Westphal <fw@strlen.de>2010-05-07 23:25:59 +0200
commitdf359835d1f8679b5d8a07c83bffe78008e85834 (patch)
treef33bf6d29070adb2d45bef3939e32185c68c6678 /src
parentdefd7e09afb62ac71859ad910e6dd52a86fb0ae2 (diff)
downloadngircd-df359835d1f8679b5d8a07c83bffe78008e85834.tar.gz
ngircd-df359835d1f8679b5d8a07c83bffe78008e85834.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/conn-ssl.c5
-rw-r--r--src/ngircd/conn.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/ngircd/conn-ssl.c b/src/ngircd/conn-ssl.c
index ae1646c5..6a0404f9 100644
--- a/src/ngircd/conn-ssl.c
+++ b/src/ngircd/conn-ssl.c
@@ -383,9 +383,10 @@ ConnSSL_Init_SSL(CONNECTION *c)
 	int ret;
 	assert(c != NULL);
 #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;
-
+	}
 	assert(c->ssl_state.ssl == NULL);
 
 	c->ssl_state.ssl = SSL_new(ssl_ctx);
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 43677540..6994c8be 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -342,7 +342,7 @@ cb_clientserver_ssl(int sock, short what)
 	case 0:
 		return;	/* EAGAIN: callback will be invoked again by IO layer */
 	default:
-		Conn_Close(idx, "Socket closed!", "SSL accept error", false);
+		Conn_Close(idx, "SSL accept error, closing socket", "SSL accept error", false);
 		return;
 	}
 	if (what & IO_WANTREAD)