如何使用 firehol 和 tinyproxy 创建一个透明的 https 代理?

Ste*_*tam 9 transparent-proxy tinyproxy

我在 Ubuntu 10.04.4 中设置了一个透明代理,其中 firehol 和 tinyproxy 适用于 http,但我无法让它适用于 https。

直接连接到 tinyproxy 可以正常工作,因为以下命令可以正常完成:

env  http_proxy=localhost:8888 curl  http://www.google.com
env https_proxy=localhost:8888 curl https://www.google.com
Run Code Online (Sandbox Code Playgroud)

Http 透明代理也可以正常工作:

curl  http://www.google.com
Run Code Online (Sandbox Code Playgroud)

但是当直接使用 https 访问 google 时,命令就挂了:

curl  https://www.google.com
Run Code Online (Sandbox Code Playgroud)

这是 firehol 和 tinyproxy 的完整配置文件。请注意,除了透明代理之外,我对使用 firehol 没有兴趣。

firehol.conf:

transparent_proxy "80 443" 8888 proxy
interface any world
   client all accept
   server all accept
Run Code Online (Sandbox Code Playgroud)

tinyproxy.conf(除了上游代理之外的所有默认值):

User    nobody
Group   nogroup
Port    8888
Timeout 600
DefaultErrorFile  "/usr/share/tinyproxy/default.html"
StatFile          "/usr/share/tinyproxy/stats.html"
Logfile           "/var/log/tinyproxy/tinyproxy.log"
LogLevel Info
PidFile           "/var/run/tinyproxy/tinyproxy.pid"
MaxClients     100
MinSpareServers  5
MaxSpareServers 20
StartServers    10
MaxRequestsPerChild 0
ViaProxyName "tinyproxy"
ConnectPort 443
ConnectPort 563
upstream corporate.fire.wall:8080
Run Code Online (Sandbox Code Playgroud)

Zor*_*che 13

据我所知,tinyproxy 根本不支持传入的 HTTPS 连接。它将允许您使用CONNECT方法访问 HTTPS 站点,但要使用该方法,浏览器/客户端必须知道它正在与代理服务器通信,并使用正确的连接方法。

这些ConnectPort指令只是定义了允许连接到哪些端口。

唯一支持透明代理 HTTPS 连接的 FOSS 产品是Squid,并且对它的支持相对较新。In 还引入了一些非常重要的安全问题,因为透明的 HTTPS 代理必须执行中间人攻击并解密连接,以便它知道要连接到什么。