diff --git a/examples/tls-proxy/src/proxy.c b/examples/tls-proxy/src/proxy.c index 754329f..adf3978 100755 --- a/examples/tls-proxy/src/proxy.c +++ b/examples/tls-proxy/src/proxy.c @@ -60,11 +60,12 @@ void client_setup(struct connection *c) { int i, fd; + const char *name; struct connection *backend; /* Paranoia. */ - if (c->ssl->session == NULL || - c->ssl->session->tlsext_hostname == NULL) { + name = SSL_get_servername(c->ssl, TLSEXT_NAMETYPE_host_name); + if (name == NULL) { kore_connection_disconnect(c); return; }