Skip to content
Permalink
Browse files

Add SNI support

Patch by: michaelortmann
Closes: #140
  • Loading branch information...
michaelortmann authored and vanosg committed Sep 7, 2019
1 parent 5083d05 commit 45ce50296a0aaad3de1604275831debb8a8374e0
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/tls.c
@@ -867,6 +867,15 @@ int ssl_handshake(int sock, int flags, int verify, int loglevel, char *host,
SSL_set_verify(td->socklist[i].ssl, SSL_VERIFY_PEER, ssl_verify);
/* Introduce 1ms lag so an unpatched hub has time to setup the ssl handshake */
nanosleep(&req, NULL);
#ifdef SSL_set_tlsext_host_name
if (!SSL_set_tlsext_host_name(td->socklist[i].ssl, data->host))
debug1("TLS: setting the server name indication (SNI) to %s failed", data->host);
else
debug1("TLS: setting the server name indication (SNI) to %s successful", data->host);
#else
debug1("TLS: setting the server name indication (SNI) not supported by ssl "
"lib, probably < openssl 0.9.8f", data->host);
#endif
ret = SSL_connect(td->socklist[i].ssl);
if (!ret)
debug0("TLS: connect handshake failed.");

0 comments on commit 45ce502

Please sign in to comment.
You can’t perform that action at this time.