better log messages for TLS configuration missing.

This commit is contained in:
Joris Vink 2018-07-11 09:52:05 +02:00
parent cffb7ec379
commit 77e0439225
2 changed files with 10 additions and 1 deletions

View File

@ -224,7 +224,9 @@ kore_connection_handle(struct connection *c)
#if !defined(KORE_NO_TLS)
case CONN_STATE_TLS_SHAKE:
if (primary_dom->ssl_ctx == NULL) {
kore_log(LOG_NOTICE, "TLS setup not yet complete");
kore_log(LOG_NOTICE,
"TLS configuration for %s not yet complete",
primary_dom->domain);
return (KORE_RESULT_ERROR);
}

View File

@ -244,6 +244,13 @@ kore_tls_sni_cb(SSL *ssl, int *ad, void *arg)
kore_debug("kore_tls_sni_cb(): received host %s", sname);
if (sname != NULL && (dom = kore_domain_lookup(sname)) != NULL) {
if (dom->ssl_ctx == NULL) {
kore_log(LOG_NOTICE,
"TLS configuration for %s not complete",
dom->domain);
return (SSL_TLSEXT_ERR_NOACK);
}
kore_debug("kore_ssl_sni_cb(): Using %s CTX", sname);
SSL_set_SSL_CTX(ssl, dom->ssl_ctx);