mirror of
https://github.com/eclipse/mosquitto.git
synced 2025-05-08 16:52:13 +08:00
Fix TLS-PSK mode not working with port 8883.
Closes #2152. Thanks to jetpax.
This commit is contained in:
parent
3ac2c3ee09
commit
7d214a445d
@ -8,6 +8,7 @@ Broker:
|
||||
Clients:
|
||||
- Set `receive-maximum` to not exceed the `-C` message count in mosquitto_sub
|
||||
and mosquitto_rr, to avoid potentially lost messages. Closes #2134.
|
||||
- Fix TLS-PSK mode not working with port 8883. Closes #2152.
|
||||
|
||||
Build:
|
||||
- A variety of minor build related fixes, like functions not having previous
|
||||
|
@ -1263,6 +1263,14 @@ int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg)
|
||||
mosquitto_lib_cleanup();
|
||||
return 1;
|
||||
}
|
||||
# ifdef FINAL_WITH_TLS_PSK
|
||||
}else if(cfg->psk){
|
||||
if(mosquitto_tls_psk_set(mosq, cfg->psk, cfg->psk_identity, NULL)){
|
||||
err_printf(cfg, "Error: Problem setting TLS-PSK options.\n");
|
||||
mosquitto_lib_cleanup();
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
}else if(cfg->port == 8883){
|
||||
mosquitto_int_option(mosq, MOSQ_OPT_TLS_USE_OS_CERTS, 1);
|
||||
}
|
||||
@ -1295,13 +1303,6 @@ int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg)
|
||||
mosquitto_lib_cleanup();
|
||||
return 1;
|
||||
}
|
||||
# ifdef FINAL_WITH_TLS_PSK
|
||||
if(cfg->psk && mosquitto_tls_psk_set(mosq, cfg->psk, cfg->psk_identity, NULL)){
|
||||
err_printf(cfg, "Error: Problem setting TLS-PSK options.\n");
|
||||
mosquitto_lib_cleanup();
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
if((cfg->tls_version || cfg->ciphers) && mosquitto_tls_opts_set(mosq, 1, cfg->tls_version, cfg->ciphers)){
|
||||
err_printf(cfg, "Error: Problem setting TLS options, check the options are valid.\n");
|
||||
mosquitto_lib_cleanup();
|
||||
|
Loading…
x
Reference in New Issue
Block a user