|
|
@ -1263,6 +1263,14 @@ int client_opts_set(struct mosquitto *mosq, struct mosq_config *cfg)
|
|
|
|
mosquitto_lib_cleanup();
|
|
|
|
mosquitto_lib_cleanup();
|
|
|
|
return 1;
|
|
|
|
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){
|
|
|
|
}else if(cfg->port == 8883){
|
|
|
|
mosquitto_int_option(mosq, MOSQ_OPT_TLS_USE_OS_CERTS, 1);
|
|
|
|
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();
|
|
|
|
mosquitto_lib_cleanup();
|
|
|
|
return 1;
|
|
|
|
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)){
|
|
|
|
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");
|
|
|
|
err_printf(cfg, "Error: Problem setting TLS options, check the options are valid.\n");
|
|
|
|
mosquitto_lib_cleanup();
|
|
|
|
mosquitto_lib_cleanup();
|
|
|
|