Email sending error "dh key too small" in Redmine's official Docker Image

Email sending error "dh key too small" in Redmine's official Docker image

I was using the official Redmine Docker image and the mail delivery did not go well

When I tested the mail delivery, the following error occurred.

An error occurred while sending mail (SSL_connect returned=1 errno=0 state=error: dh key too small)

Cause

Apparently, the DH key on the mail server side is short, and it seems that the security conditions of OpenSSL on the Redmine side are not met. When I entered the Redmine container and checked the OpenSSL settings (/etc/ssl/openssl.cnf), it was SECLEVEL = 2. Redmine container seems to be Debian type.

CipherString = DEFAULT@SECLEVEL=2

Coping

Since there is no help for it, I lowered it to SECLEVEL = 1 and now I can deliver mail. You can rewrite from 2 to 1 by typing the following command in the container.

# sed -i -e 's/CipherString = DEFAULT@SECLEVEL=2/CipherString = DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf

From outside the container, the following command

# docker exec -i -t (Redmine container) /bin/sh -c "sed -i -e 's/CipherString = DEFAULT@SECLEVEL=2/CipherString = DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf"

in conclusion

If you find it useful, please use LGTM.

Recommended Posts

Email sending error "dh key too small" in Redmine's official Docker Image
Install yarn in docker image
npm error in docker tutorial
Implement Email Sending in Java
"Dh key too small" appears when connecting to https on Ubuntu