mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-24 09:14:02 +08:00
Adding tls host name extension (SNI)
Signed-off-by: Viktor Gotwig <viktor.gotwig@q-loud.de>
This commit is contained in:
committed by
Roger A. Light
parent
6dd63d3000
commit
e90afb8526
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user