|
|
|
@ -281,14 +281,7 @@ int _mosquitto_try_connect(struct mosquitto *mosq, const char *host, uint16_t po
|
|
|
|
|
|
|
|
|
|
*sock = INVALID_SOCKET;
|
|
|
|
|
memset(&hints, 0, sizeof(struct addrinfo));
|
|
|
|
|
#ifdef WITH_TLS
|
|
|
|
|
if(mosq->tls_cafile || mosq->tls_capath || mosq->tls_psk){
|
|
|
|
|
hints.ai_family = PF_INET;
|
|
|
|
|
}else
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
hints.ai_family = PF_UNSPEC;
|
|
|
|
|
}
|
|
|
|
|
hints.ai_flags = AI_ADDRCONFIG;
|
|
|
|
|
hints.ai_socktype = SOCK_STREAM;
|
|
|
|
|
|
|
|
|
@ -542,6 +535,7 @@ int _mosquitto_socket_connect(struct mosquitto *mosq, const char *host, uint16_t
|
|
|
|
|
COMPAT_CLOSE(sock);
|
|
|
|
|
return MOSQ_ERR_TLS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SSL_set_ex_data(mosq->ssl, tls_ex_index_mosq, mosq);
|
|
|
|
|
bio = BIO_new_socket(sock, BIO_NOCLOSE);
|
|
|
|
|
if(!bio){
|
|
|
|
|