Commit bbf385b
committed
Fix OpenSSL config loading race condition for TLS engines
When setting MOSQ_OPT_TLS_ENGINE, mosquitto_string_option()
initializes the OpenSSL singleton via OPENSSL_init_crypto
but omits the OPENSSL_INIT_LOAD_CONFIG flag.
If an engine is set before mosquitto_connect_async() (which
calls net__init_tls()), OpenSSL locks its initialization
state without reading openssl.cnf. This causes engines like
pkcs11 to fail to resolve their MODULE_PATH, resulting in
dlopen failures for hardware TrustZone/HSM modules.
Adding OPENSSL_INIT_LOAD_CONFIG to the engine initialization
ensures the configuration is parsed and the engine can locate
its dynamic backend.
Signed-off-by: Jack(Boliang) Ma <jack.boliang.ma106@gmail.com>1 parent bb56477 commit bbf385b
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
0 commit comments