|
|
@ -458,6 +458,7 @@ static int net__init_ssl_ctx(struct mosquitto *mosq)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(mosq->tls_cafile || mosq->tls_capath || mosq->tls_psk){
|
|
|
|
if(mosq->tls_cafile || mosq->tls_capath || mosq->tls_psk){
|
|
|
|
|
|
|
|
if(!mosq->ssl_ctx){
|
|
|
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
|
|
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
|
|
|
mosq->ssl_ctx = SSL_CTX_new(SSLv23_client_method());
|
|
|
|
mosq->ssl_ctx = SSL_CTX_new(SSLv23_client_method());
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -470,6 +471,7 @@ static int net__init_ssl_ctx(struct mosquitto *mosq)
|
|
|
|
net__print_ssl_error(mosq);
|
|
|
|
net__print_ssl_error(mosq);
|
|
|
|
return MOSQ_ERR_TLS;
|
|
|
|
return MOSQ_ERR_TLS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!mosq->tls_version){
|
|
|
|
if(!mosq->tls_version){
|
|
|
|
SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_SSLv3);
|
|
|
|
SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_SSLv3);
|
|
|
|