0
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 1 year has passed since last update.

[ubuntu 22.04 LTS] TLS library problem alert number 45 [未解決?]

Last updated at Posted at 2022-09-10

メールが届かない

 特定のクライアントのみssl関連のアラートが出てメールが届かない事例。接続元はほとんどの人は聞いた事があるであろうワールドワイドに大きな会社の日本支社のメールサーバー。

 mail.logには以下のエラーが出力されている。

/var/log/mail.log
Sep  2 17:02:25 mydomain postfix/smtpd[47272]: connect from xxx.xxxxx.co.jp[xxx.xxx.xxx.xxx]
Sep  2 17:02:26 mydomain postfix/smtpd[47272]: SSL_accept error from xxx.xxxxx.co.jp[xxx.xxx.xxx.xxx]: -1
Sep  2 17:02:26 mydomain postfix/smtpd[47272]: warning: TLS library problem: error:0A000415:SSL routines::sslv3 alert certificate expired:../ssl/record/rec_layer_s3.c:1584:SSL alert number 45:
Sep  2 17:02:26 mydomain postfix/smtpd[47272]: lost connection after STARTTLS from xxx.xxxxx.co.jp[xxx.xxx.xxx.xxx]
Sep  2 17:02:26 mydomain postfix/smtpd[47272]: disconnect from xxx.xxxxx.co.jp[xxx.xxx.xxx.xxx] ehlo=1 starttls=0/1 commands=1/2

 調べてみたところ原因は多岐にわたる様子。こちら側の問題の場合もあれば、相手側の問題の場合もあるらしい。

チェック1:証明書の期限

 こちらの証明書の期限が切れているとこのエラーが出るらしい。

openssl x509 -noout -text -in /etc/letsencrypt/live/xxxxx.jp/fullchain.pem
結果
       ~略~
        Validity
            Not Before: Jul 30 17:36:41 2022 GMT
            Not After : Oct 28 17:36:40 2022 GMT  # ← コレが期限

 期限は問題なしだった。

チェック2:証明書パス

 postfixの設定ファイルの以下の項目が、現在有効な証明書のパスが指定されているか確認する。

/etc/postfix/main.cf
smtp_tls_cert_file=/etc/letsencrypt/live/xxxxx.jp/fullchain.pem

 証明書が更新されたらpostfixをリロードする必要がある。

systemctl reload postfix

 今回はパスの記載に間違いは無かったのでリロードのみ行ったが改善せず。

チェック3:設定記述の確認

 postfixの設定記述を確認する。

postfix check

 今回の件とは関係あるか不明だが、以下のエラーが出た。

postfix check実行結果
warning: /etc/letsencrypt/live/xxxxx.jp/chain.pem /var/spool/postfix/etc/letsencrypt/live/xxxxx.jp/fullchain.pem defer
warning: /etc/letsencrypt/live/xxxxx.jp/chain.pem /var/spool/postfix/etc/letsencrypt/live/xxxxx.jp/chain.pem defer
warning: /etc/letsencrypt/live/xxxxx.jp/chain.pem /var/spool/postfix/etc/letsencrypt/live/xxxxx.jp/privkey.pem defer

 /var/spool/postfix/etc/letsencrypt/live/xxxxx.jp内にあるfullchain.pemchain.pemprivkey.pemは、何かのタイミングで作成されてそのまま更新されていない様子。同名でシンボリックリンクを作成した。

# 現在のpemをリネーム
mv /var/spool/postfix/etc/letsencrypt/live/xxxxx.jp/fullchain.pem /var/spool/postfix/etc/letsencrypt/live/xxxxx.jp/fullchain.pem.old

# シンボリックリンクを作成
ln -s /var/spool/postfix/etc/letsencrypt/live/xxxxx.jp/fullchain.pem /etc/letsencrypt/live/xxxxx.jp/fullchain.pem

# 他2件も同様に処理

 エラーは出力されなくなったが改善せず。

チェック4:証明書ストア設定

 /etc/ca-certificates.confファイルの以下の項目で行頭に「!」が記載されているか確認する。

/etc/ca-certificates.conf
!mozilla/DST_Root_CA_X3.crt

 無い場合は「!」を追記して証明書ストアのアップデートコマンドを実行。

update-ca-certificates

 今回は「!」が記載されていたので、updateコマンドのみ実行したが、更新は0件だった。改善せず。

チェック5:相手側の問題

 送信元のメールサーバーがOpenSSL 1.0.1、または1.0.2を使用している場合にこのエラーが出るらしい。これは相手がアップデートしてくれるのを待つしかない。これかなぁ・・・

 以下コマンドで接続元のssl対応状況を調べたが、Connection refusedだった。おそらくTLS1.2に対応していない?

openssl s_client -connect xxx.xxx.xxx.xxx:443 -tls1_2

# 443を25とか465とか587に変更したけど結果は変化なし

結論

 送信元には申し訳ないが、相手に合わせてこちらのセキュリティレベルを下げるわけにはいかない。相手側のアップデートを待つ事にした。

参考サイト

0
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
0
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?