mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-21 15:23:46 +08:00
Fix TLS certs and PSK not being able to be config'd at the same time.
This commit is contained in:
@@ -6,6 +6,8 @@ Broker:
|
||||
configuration file. Unless your configuration file is writable by untrusted
|
||||
users this is not a risk. Closes #567213.
|
||||
- Fix `max_connections` option not being correctly counted.
|
||||
- Fix TLS certificates and TLS-PSK not being able to be configured at the same
|
||||
time.
|
||||
|
||||
Client library:
|
||||
- If a client uses TLS-PSK then force the default cipher list to use "PSK"
|
||||
|
||||
@@ -879,8 +879,9 @@ int net__socket_listen(struct mosquitto__listener *listener)
|
||||
if(net__tls_load_verify(listener)){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
# ifdef FINAL_WITH_TLS_PSK
|
||||
}else if(listener->psk_hint){
|
||||
if(listener->psk_hint){
|
||||
if(tls_ex_index_context == -1){
|
||||
tls_ex_index_context = SSL_get_ex_new_index(0, "client context", NULL, NULL, NULL);
|
||||
}
|
||||
@@ -888,8 +889,10 @@ int net__socket_listen(struct mosquitto__listener *listener)
|
||||
tls_ex_index_listener = SSL_get_ex_new_index(0, "listener", NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
if(net__tls_server_ctx(listener)){
|
||||
return 1;
|
||||
if(listener->certfile == NULL || listener->keyfile == NULL){
|
||||
if(net__tls_server_ctx(listener)){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
SSL_CTX_set_psk_server_callback(listener->ssl_ctx, psk_server_callback);
|
||||
if(listener->psk_hint){
|
||||
|
||||
Reference in New Issue
Block a user