![Squid!严重错误:未为 HTTPS_port 配置有效的签名证书](https://linux22.com/image/769170/Squid%EF%BC%81%E4%B8%A5%E9%87%8D%E9%94%99%E8%AF%AF%EF%BC%9A%E6%9C%AA%E4%B8%BA%20HTTPS_port%20%E9%85%8D%E7%BD%AE%E6%9C%89%E6%95%88%E7%9A%84%E7%AD%BE%E5%90%8D%E8%AF%81%E4%B9%A6.png)
我已经在 Ubuntu 20.04 上使用 Squid 4.13 大约一周了。
我最近遇到的(希望也是最后一个)问题是:
严重错误:未为 HTTPS_port 配置有效的签名证书
这是我的话:
https_port 0.0.0.0:3128 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/usr/local/squid/etc/rootCA.crt key=/usr/local/squid/etc/rootCA.key options=SINGLE_DH_USE,SINGLE_ECDH_USE tls-dh=/usr/local/squid/etc/dhparam.pem
我已经到处找过了(至少感觉如此),甚至 squids 自己的 wiki(https://wiki.squid-cache.org/ConfigExamples/Intercept/SslBumpExplicit) 是 vierd?因为一开始他们展示了如何制作 .pem 文件,但在文档末尾他们展示了示例行,他们谈论的是 .crt 和 .key 以及完全不同的 .pem 文件。
我唯一改变的是将位数提高到 4096
所以我又迷路了!有人知道他们在说什么吗?正确的格式是什么,怎么做……啊!帮帮忙?
编辑:这是我正在使用的“标准”配置:
acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN)
acl localnet src 100.64.0.0/10 # RFC 6598 shared address space (CGN)
acl localnet src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines
acl localnet src 172.16.0.0/12 # RFC 1918 local private network (LAN)
acl localnet src 192.168.0.0/16 # RFC 1918 local private network (LAN)
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
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
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
include /etc/squid/conf.d/*
http_access allow localhost
http_access allow all
include /etc/squid/conf.d/*
https_port 0.0.0.0:3128 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB tls-cert=/usr/local/squid/etc/Root-ca-cert.pem cert=/usr/local/squid/etc/rootCA.crt key=/usr/local/squid/etc/rootCA.key options=SINGLE_DH_USE,SINGLE_ECDH_USE tls-dh=/usr/local/squid/etc/dhparam.pem
/etc/squid/conf.d 中包含的配置是一个名为 debian.conf 的文件:
#
# Squid configuration settings for Debian
#
# Logs are managed by logrotate on Debian
logfile_rotate 0
# For extra security Debian packages only allow
# localhost to use the proxy on new installs
#
#http_access allow localnet
按照要求:
Aug 4 12:25:47 socks systemd[1]: Starting Squid Web Proxy Server...
Aug 4 12:25:52 socks squid[9474]: 2021/08/04 12:25:52| FATAL: No valid signing certificate configured for HTTPS_port 0.0.0.0:3128
Aug 4 12:25:52 socks squid: FATAL: No valid signing certificate configured for HTTPS_port 0.0.0.0:3128
Aug 4 12:25:52 socks squid[9474]: 2021/08/04 12:25:52| Squid Cache (Version 4.13): Terminated abnormally.
Aug 4 12:25:52 socks squid[9474]: CPU Usage: 5.132 seconds = 5.128 user + 0.004 sys
Aug 4 12:25:52 socks squid[9474]: Maximum Resident Size: 62224 KB
Aug 4 12:25:52 socks squid[9474]: Page faults with physical i/o: 0
Aug 4 12:25:52 socks systemd[1]: squid.service: Control process exited, code=exited, status=1/FAILURE
Aug 4 12:25:52 socks systemd[1]: squid.service: Failed with result 'exit-code'.
Aug 4 12:25:52 socks systemd[1]: Failed to start Squid Web Proxy Server.
答案1
解决方案的一部分是 ID 10 T 问题,显然证书有缺陷,即使测试表明它没有问题,但在创建新证书后它就起作用了。
后来出现的有关循环的问题,在这里被确定:https://unix.stackexchange.com/questions/664236/squid-proxy-is-eating-up-its-own-resources-and-other-issues
并且新的问题布局已发布在此处:https://unix.stackexchange.com/questions/664669/squid-caught-in-loop-cert-error