SSL_CTX is not cleared on disconnect - it conflicts with default MOSQ_OPT_SSL_CTX_WITH_DEFAULTS #2288
Labels
Component: libmosquitto
Status: Completed
Nothing further to be done with this issue, it can be closed by the requestor or committer.
Type: Bug
Milestone
When no SSL_CTX is specified by the user, no MOSQ_OPT_SSL_CTX_WITH_DEFAULTS set (so by default mosq->ssl_ctx_defaults is true), on first run mosq->ssl_ctx is null, while on second it is already not null and it fall in the error here: https://github.com/eclipse/mosquitto/blob/master/lib/net_mosq.c#L671
So mosq_disconnect and then mosq_connect again will fail.
You should save the SSL_CTX defined by the user in another veriable mosq->user_ssl_ctx and copy it before each connect to ssl_ctx and clear in disconnect.
The text was updated successfully, but these errors were encountered: