diff --git a/include/proto/openssl-compat.h b/include/proto/openssl-compat.h index a1e75b47b..ea92072e5 100644 --- a/include/proto/openssl-compat.h +++ b/include/proto/openssl-compat.h @@ -94,11 +94,6 @@ static inline int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned cha * Functions introduced in OpenSSL 1.1.0 and not yet present in LibreSSL */ -static inline const char *SSL_SESSION_get0_hostname(const SSL_SESSION *sess) -{ - return sess->tlsext_hostname; -} - static inline const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *sess, unsigned int *sid_ctx_length) { *sid_ctx_length = sess->sid_ctx_length; diff --git a/src/ssl_sock.c b/src/ssl_sock.c index fa8157155..42d27de9f 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -3951,11 +3951,7 @@ static int ssl_sock_srv_verifycbk(int ok, X509_STORE_CTX *ctx) */ servername = objt_server(conn->target)->ssl_ctx.verify_host; if (!servername) { - SSL_SESSION *ssl_sess = SSL_get_session(conn->xprt_ctx); - if (!ssl_sess) - return ok; - - servername = SSL_SESSION_get0_hostname(ssl_sess); + servername = SSL_get_servername(conn->xprt_ctx, TLSEXT_NAMETYPE_host_name); if (!servername) return ok; }