Skip to content

Commit

Permalink
Reference counting for openssl 1.0.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Apr 16, 2018
1 parent a29ee5d commit b2bb48a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@ int mosquitto_opts_set(struct mosquitto *mosq, enum mosq_opt_t option, void *val
}
break;
case MOSQ_OPT_SSL_CTX:
#if defined(WITH_TLS) && OPENSSL_VERSION_NUMBER >= 0x10100000L
mosq->ssl_ctx = (SSL_CTX *)value;
if(mosq->ssl_ctx){
#if defined(WITH_TLS) && OPENSSL_VERSION_NUMBER >= 0x10100000L
SSL_CTX_up_ref(mosq->ssl_ctx);
}
break;
#else
return MOSQ_ERR_NOT_SUPPORTED;
CRYPTO_add(&(mosq->ssl_ctx)->references, 1, CRYPTO_LOCK_SSL_CTX);
#endif
}
break;
case MOSQ_OPT_SSL_CTX_WITH_DEFAULTS:
#if defined(WITH_TLS) && OPENSSL_VERSION_NUMBER >= 0x10100000L
mosq->ssl_ctx_defaults = true;
Expand Down

0 comments on commit b2bb48a

Please sign in to comment.