LoginSignup
0
1

More than 3 years have passed since last update.

[squidでhttpsプロキシ] dh key too small で発生したエラーの解消

Posted at

はじめに

sslインターセプトするhttpsプロキシを運用していて、不具合があった点が解消できましたので、記録します。
利用する環境は、前回構築した以下のものです。
squidでActiveDirectory連携とSSLインターセプトするProxyをdockerで手軽につくる

なにが起こったのか

以下のサイトに接続しようとすると、エラーが発生。
https://blog.goo.ne.jp/

Screenshot from Gyazo

エラーの内容は
(71) Protocol error (TLS code: SQUID_ERR_SSL_HANDSHAKE)
Handshake with SSL server failed: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small
というものだった。

原因調査

tls_process_ske_dhe:dh key too small というエラー。
サーバ証明書がsquidが要求するDH鍵長よりも短いため、はじかれているようだ。

CentOS8では crypto-policies という仕組みが用意されており、システム全体で暗号化ポリシーを一元的に管理しているようだ。
そのポリシーはプリセットで管理されており、 LEGACY / DEFAULT / FIPS / FUTURE の順で厳しくなっていく。

現在の設定は update-crypto-policies --show というコマンドで確認できる。

# update-crypto-policies --show
DEFAULT

参考にした RHEL8のサイト では、DEFAULTのDH鍵長は最低2048bitとなっている。
これを LEGACY にすれば、DH鍵長が短くても許容できるだろう。

が、システム全体でレベルを下げる、というのはちょっと引っかかる。

解決方法

squid.conf の tls_outgoing_optionsディレクティブで暗号化セットの指定があったので、これで試してみる。

squid.conf
tls_outgoing_options cipher=DEFAULT:@SECLEVEL=1

Screenshot from Gyazo

これでOK

出典

参考にさせていただきました。
http://www.squid-cache.org/Doc/config/tls_outgoing_options/
https://yoku0825.blogspot.com/2019/12/centos-80url-error141a318assl.html
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening
https://stackoverflow.com/questions/53058362/openssl-v1-1-1-ssl-choose-client-version-unsupported-protocol

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