Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn capath option is not supported for websockets #3165

Open
wants to merge 1 commit into
base: fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions man/mosquitto.conf.5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</para>
<para><option>capath</option> is not supported for websockets.</para>
</listitem>
</varlistentry>
<varlistentry>
Expand Down
1 change: 1 addition & 0 deletions mosquitto.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path to capath>" each time you add/remove a certificate.
# capath is not supported for websockets.
#cafile
#capath

Expand Down
7 changes: 6 additions & 1 deletion src/websockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down