Noticed a crash (EXC_BAD_ACCESS) on the password callback (pw_callback in MosquittoCallbackBridge) when it tries to cast the userdata object. I passed in the password of the private key file via MQTTClientCert object on MQTTConfig.
Found the problem was that mosq was passed in as the userdata instead of mosq->userdata. See the diff.
Hope this makes sense! :)
Btw for completeness, here's how I encrypted the private key:
$ openssl pkcs8 -topk8 -v2 des3 -in mqtt.key -out mqtt-encrypted.key
Noticed a crash (EXC_BAD_ACCESS) on the password callback (
pw_callback
inMosquittoCallbackBridge
) when it tries to cast the userdata object. I passed in the password of the private key file viaMQTTClientCert
object onMQTTConfig
.Found the problem was that
mosq
was passed in as the userdata instead ofmosq->userdata
. See the diff.Hope this makes sense! :)
Btw for completeness, here's how I encrypted the private key:
$ openssl pkcs8 -topk8 -v2 des3 -in mqtt.key -out mqtt-encrypted.key