加密浏览器代理 (Squid) 连接

加密浏览器代理 (Squid) 连接

我正在尝试在浏览器和我们的代理(squid)之间建立加密通信

从理论上讲,它必须能够与现代浏览器兼容,正如 squid 官方文档中提到的那样: https://wiki.squid-cache.org/Features/HTTPS#Encrypted_browser-Squid_connection

我尝试在 dockerized Alpine 和带有 openssl 模块的 squid 5.5 上实现此功能

squid配置文件, 我有:

...
http_port 3128
https_port 3129 cert=/etc/squid/crt.pem key=/etc/squid/key.pem
...

但是当我请求 squid https 端口时,每次都会出现这个错误,缓存日志

...
ERROR: failure while accepting a TLS connection on conn77 local=172.17.0.2:3129 remote=172.17.0.1:56608 FD 12 flags=1: 0x7fbd208f33e0*1
    connection: conn77 local=172.17.0.2:3129 remote=172.17.0.1:56608 FD 12 flags=1
Pipeline.cc(31) front: Pipeline 0x7fbd208f13a0 empty
Error.cc(22) update: recent: ERR_SECURE_ACCEPT_FAIL/SQUID_TLS_ERR_ACCEPT+TLS_LIB_ERR=1408F09B+TLS_IO_ERR=1
...

我还在 Ubuntu 20.40 环境中使用带有 gnutls 模块的 squid 4.10 和相同的 squid.conf 尝试了此操作,但再次收到 TLS 错误

...
client_side.cc(2597) tlsAttemptHandshake: Error negotiating TLS on local=x.x.x.x:3129 remote=x.x.x.x:50874 FD 11 flags=1: Aborted by client: An unexpected TLS packet was received.
...

对于这两种情况,我都使用了自签名证书和由我们的 CA 签名的生成证书

另外,我尝试了多个 https_port 选项(禁用一些 SSL 实现、操作客户端证书......),但没有成功

有人可以告诉我我所缺少的是什么吗?

更新

我忘了说这个问题只存在于网络浏览器中,curl 成功加密了与代理的连接

因此,我使用 Wireshark 捕获 Web 浏览器(Firefox)和 curl 的流量,我发现,除非 curl,否则 Firefox 不会与代理启动 tls 握手

Firefox 捕获: Firefox_capture

卷曲捕获: Curl_capture

相关内容