Skip to content

Commit

Permalink
The server was crashing when a SNI enabled connection accessed a
Browse files Browse the repository at this point in the history
virtual server without TLS support. This patch should fix:
http://bugs.cherokee-project.com/523


git-svn-id: svn://cherokee-project.com/cherokee/trunk@3444 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed Jul 11, 2009
1 parent 45aa865 commit ffd8774
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cherokee/cryptor_libssl.c
Expand Up @@ -210,6 +210,15 @@ openssl_sni_servername_cb (SSL *ssl, int *ad, void *arg)
TRACE (ENTRIES, "SNI: Setting new TLS context. Virtual host='%s'\n",
vsrv->name.buf);

/* Check whether the Virtual Server supports TLS
*/
if ((vsrv->cryptor == NULL) ||
(CRYPTOR_VSRV_SSL(vsrv->cryptor)->context == NULL))
{
TRACE (ENTRIES, "Virtual server '%s' does not support SSL\n", servername);
return SSL_TLSEXT_ERR_NOACK;
}

/* Set the new SSL context
*/
ctx = SSL_set_SSL_CTX (ssl, CRYPTOR_VSRV_SSL(vsrv->cryptor)->context);
Expand Down

0 comments on commit ffd8774

Please sign in to comment.