我有 Squid 4.4 和 RHEL8 上 SSL 碰撞的工作配置。不过,我发现少数没有设置 SSL 的网站(例如http://squidguard.org)无法正常工作。
我不得不使用几个不同的来源拼凑我的配置,因为似乎没有一个提供确定的方法来设置 SSL 碰撞。我可能错过了一些允许 Squid 处理 HTTP 和 HTTPS 流量的东西?
这是我在日志中看到的:
1624658033.150 59887 10.108.0.18 TCP_MISS/503 4300 GET http://squidguard.com/favicon.ico - HIER_DIRECT/3.223.115.185 text/html
1624658042.966 60608 10.108.0.18 TCP_MISS/503 4392 GET http://squidguard.com/ - HIER_DIRECT/3.223.115.185 text/html
浏览器页面上的错误说
The following error was encountered while trying to retrieve the URL: http://squidguard.com/
Connection to 3.223.115.185 failed.
The system returned: (110) Connection timed out
The remote host or network may be down. Please try the request again.
不过,远程主机或网络并未关闭。我可以在不通过代理时到达它。
我的 squid.conf:
acl vdi src 10.108.0.0/20
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl intermediate_fetching transaction_initiator certificate-fetching
http_access allow intermediate_fetching
http_access deny !Safe_ports
http_access allow localhost manager
http_access deny manager
http_access allow vdi
http_access deny all
http_port 0.0.0.0:3128
http_port 0.0.0.0:3129 ssl-bump cert=/etc/squid/ssl_cert/myCA.pem generate-host-certificates=on
https_port 0.0.0.0:3130 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=20MB cert=/etc/squid/ssl_cert/myCA.pem
sslcrtd_program /usr/lib64/squid/security_file_certgen -s /var/lib/squid/ssl_db -M 20MB
ssl_bump stare all
ssl_bump bump all
cache_dir ufs /var/spool/squid 100 16 256
coredump_dir /var/spool/squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
shutdown_lifetime 1 second
我没有运行 iptables,所以我没有任何 REDIRECT 规则。我确实怀疑这是问题所在。
这个问题没有实际意义。问题的根源超出了 Squid 的范围,甚至超出了运行它的服务器。端口 80 被防火墙阻止。
您只需使用以下内容即可解决此问题
删除另一个