Adding tls host name extension (SNI)

Signed-off-by: Viktor Gotwig <viktor.gotwig@q-loud.de>
This commit is contained in:
Viktor Gotwig 2017-11-21 15:58:25 +01:00 committed by Roger A. Light
parent 6dd63d3000
commit e90afb8526

View File

@ -589,6 +589,14 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host, uint16_t
}
SSL_set_bio(mosq->ssl, bio, bio);
/*
* required for the SNI resolving
*/
if(SSL_set_tlsext_host_name(mosq->ssl, host) != 1) {
COMPAT_CLOSE(mosq->sock);
return MOSQ_ERR_TLS;
}
if(net__socket_connect_tls(mosq)){
return MOSQ_ERR_TLS;
}