diff --git a/man/mosquitto.conf.5.xml b/man/mosquitto.conf.5.xml index 90509fd4b..898d48be8 100644 --- a/man/mosquitto.conf.5.xml +++ b/man/mosquitto.conf.5.xml @@ -1326,6 +1326,7 @@ log_timestamp_format %Y-%m-%dT%H:%M:%S "openssl rehash <path to capath>" each time you add/remove a certificate. + is not supported for websockets. diff --git a/mosquitto.conf b/mosquitto.conf index 10b0406eb..afaad5a20 100644 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -359,6 +359,7 @@ # containing the CA certificates. For capath to work correctly, the # certificate files must have ".crt" as the file ending and you must run # "openssl rehash " each time you add/remove a certificate. +# capath is not supported for websockets. #cafile #capath diff --git a/src/websockets.c b/src/websockets.c index 4d91579ad..aa1fcccaf 100644 --- a/src/websockets.c +++ b/src/websockets.c @@ -698,7 +698,12 @@ void mosq_websockets_init(struct mosquitto__listener *listener, const struct mos info.gid = -1; info.uid = -1; #ifdef WITH_TLS - info.ssl_ca_filepath = listener->cafile; + if(listener->cafile){ + info.ssl_ca_filepath = listener->cafile; + } + else if(listener->capath){ + log__printf(NULL, MOSQ_LOG_WARNING, "Warning: CA path option is not supported for websockets"); + } info.ssl_cert_filepath = listener->certfile; info.ssl_private_key_filepath = listener->keyfile; info.ssl_cipher_list = listener->ciphers;