Skip to content

Commit

Permalink
TLS: use Server Name Indication
Browse files Browse the repository at this point in the history
This allows sites that require a hostname to work correctly.
  • Loading branch information
kruton committed Jan 6, 2024
1 parent 9d18c6b commit 1e8ac0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,12 @@ static int establish(Sock *sock)
#if HAVE_SSL
if (xsock->ssl) {
int sslret;
sslret = SSL_connect(xsock->ssl);
if (xsock->host != NULL)
sslret = SSL_set_tlsext_host_name(xsock->ssl, xsock->host);

if (sslret == 1)
sslret = SSL_connect(xsock->ssl);

if (sslret <= 0) {
setupnextconn(xsock);
ssl_io_err(xsock, sslret, xsock->addr ? H_ICONFAIL : H_CONFAIL);
Expand Down

0 comments on commit 1e8ac0b

Please sign in to comment.