Skip to content

Commit

Permalink
lib: Fix DH group not being set for TLS connections.
Browse files Browse the repository at this point in the history
This meant ciphers using DHE couldn't be used.

Closes #1925. Closes #1476. Thanks to Jonathan Sönnerup, Valerii
Demeshko, and sectokia.
  • Loading branch information
ralight committed Dec 9, 2020
1 parent e81216c commit 26e6bfb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Expand Up @@ -2,6 +2,7 @@ Broker:
- Fix crash on Windows if loading a plugin fails. Closes #1866.
- Fix DH group not being set for TLS connections, which meant ciphers using
DHE couldn't be used. Closes #1925. Closes #1476.

- Fix listener not being reassociated with client when reloading a persistence
file and `per_listener_settings true` is set and the client did not set a
username. Closes #1891.
Expand All @@ -10,6 +11,8 @@ Broker:

Client library:
- Fix build on Mac Big Sur. Closes #1905.
- Fix DH group not being set for TLS connections, which meant ciphers using
DHE couldn't be used. Closes #1925. Closes #1476.

Clients:
- mosquitto_sub will now quit with an error if the %U option is used on
Expand Down
4 changes: 4 additions & 0 deletions lib/net_mosq.c
Expand Up @@ -648,6 +648,10 @@ static int net__init_ssl_ctx(struct mosquitto *mosq)
return MOSQ_ERR_INVAL;
}

#if OPENSSL_VERSION_NUMBER >= 0x10100000L
/* Allow use of DHE ciphers */
SSL_CTX_set_dh_auto(mosq->ssl_ctx, 1);
#endif
/* Disable compression */
SSL_CTX_set_options(mosq->ssl_ctx, SSL_OP_NO_COMPRESSION);

Expand Down

0 comments on commit 26e6bfb

Please sign in to comment.