Date: 2024oct11
Product: Dovecot
Q. Dovecot: imap-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssl_dh=</path/to/dh.pem
A. As root:
cd /etc/dovecot
openssl dhparam 4096 > dh.pem
(It takes a long time)
cd conf.d
vi 10-ssl.conf
Uncomment this line:
ssl_dh = </etc/dovecot/dh.pem
Restart the service:
systemctl restart dovecot
There is advice out there suggesting that you modify ssl_min_protocol, ssl_cipher_list and other
parameters but changing them isn't necessary to fix this error and I prefer to leave those as default.