]> arthur.barton.de Git - ngircd-alex.git/commitdiff
SSL/TLS: fix bogus 'socket closed' error message
authorFlorian Westphal <fw@strlen.de>
Fri, 7 May 2010 21:25:59 +0000 (23:25 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 7 May 2010 21:25:59 +0000 (23:25 +0200)
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.

src/ngircd/conn-ssl.c
src/ngircd/conn.c

index ae1646c5571fb13da78362837330d48b245cdae5..6a0404f9e052e6b5e463505d711d3a95f1f48f8e 100644 (file)
@@ -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);
index 4367754061ab7779423af62dcefcc66f25b9a649..6994c8be8d7fb3876bc88961c95cac258a16f5d3 100644 (file)
@@ -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)