1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Redmineの公式Docker Imageでメール送信エラー"dh key too small"

Last updated at Posted at 2020-09-24

Redmineの公式Dockerイメージでメール送信エラー"dh key too small"

Redmine公式Dockerイメージを使っていてメール配信がなかなかうまくいかなかった

メール配信のテストを行うと以下のエラーが発生しました。

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

原因

どうやらメールサーバ側のDH鍵が短く、Redmine側のOpenSSLのセキュリティ条件を満たせていない様子。
Redmineのコンテナに入り、OpenSSLの設定(/etc/ssl/openssl.cnf)を調べたらSECLEVEL=2になっていました。
RedmineのコンテナはDebian系のようです。

CipherString = DEFAULT@SECLEVEL=2

対処

仕方がないのでSECLEVEL=1に下げたところメールが配信できるようになりました。
コンテナ内で下記のコマンドを打つことで2から1へ書き換えができます。

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

コンテナの外からだったら下記のコマンド

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

おわりに

役に立ちましたらLGTMをお願いいたします。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?