tinyproxy 透明代理的一些疑问。。。

2017-03-17 16:05:17 +08:00
 RshMan

一台 linux 主机,拥有两块网卡,一块接外网,一块做局域网接另外一台电脑,现在在 linux 主机上部署 tinyproxy 代理服务器,将局域网访问 80 , 443 端口的数据重定向到代理服务器中: 1.iptables -t nat -A PREROUTING -i lan0 -s 192.168.0.0/24 -p tcp --dport 80 -j REDIRECT --to-ports 8888 2.iptables -t nat -A PREROUTING -i lan0 -s 192.168.0.0/24 -p tcp --dport 443 -j REDIRECT --to-ports 8888

tinyproxy 的配置如下:

User root Group root

Port 8888

Timeout 600

DefaultErrorFile "/usr/share/tinyproxy/default.html" StatFile "/usr/share/tinyproxy/stats.html" LogFile "/usr/var/log/tinyproxy/tinyproxy.log"

LogLevel Info PidFile "/usr/var/run/tinyproxy/tinyproxy.pid" MaxClients 100 MinSpareServers 5 MaxSpareServers 20 StartServers 10 MaxRequestsPerChild 0

ViaProxyName "router"

Filter "/usr/etc/tinyproxy/filter" FilterURLs On FilterDefaultDeny No

ConnectPort 443 ConnectPort 563

现在的问题是 http 的访问没有问题,但是无法访问 https 的网站,是不是这样部署透明代理相当于一个中间者拦截了 https ,导致连接的证书认证过程无法实现?还是说在 iptables 中应该再配置一些规则?

4169 次点击
所在节点    Linux
6 条回复
thekll
2017-03-18 01:15:23 +08:00
没用过 tinyproxy , https 应该要配置 upstream proxy 吧。
thekll
2017-03-18 01:48:57 +08:00
也有可能 tinyproxy 并不支持 https 的透明代理,那个官方文档的描述也很模糊。
RshMan
2017-03-20 08:35:47 +08:00
@thekll tinyproxy 是支持透明代理的,没说可不可以支持 https , http 是可以的,这个问题困扰很久
la0wei
2017-03-22 10:40:26 +08:00
我用过 privoxy ,不过没有尝试 https 。
我建议你看 tinyproxy 的日志
https 通过 http 代理理论上是可以的
RshMan
2017-03-23 09:18:32 +08:00
@la0wei 理论上是可以让 443 端口的请求通过 connect 的连接,代理服务器只负责转发,建立起连接 ,但是透明代理使用了 iptables 重定向后,似乎改变了报文,访问 https 就报 ssl 的错误,还是没能搞懂,看日志即使我访问了 https 的网站也没在日志中发现任何 443 端口相关的参数
ecloud
2019-06-06 23:51:19 +08:00
似乎这个问题还是无解?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/348240

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX