V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
RshMan
V2EX  ›  Linux

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

  •  
  •   RshMan · 2017-03-17 16:05:17 +08:00 · 4147 次点击
    这是一个创建于 2568 天前的主题,其中的信息可能已经有所发展或是发生改变。

    一台 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 中应该再配置一些规则?

    6 条回复    2019-06-06 23:51:19 +08:00
    thekll
        1
    thekll  
       2017-03-18 01:15:23 +08:00 via iPhone
    没用过 tinyproxy , https 应该要配置 upstream proxy 吧。
    thekll
        2
    thekll  
       2017-03-18 01:48:57 +08:00
    也有可能 tinyproxy 并不支持 https 的透明代理,那个官方文档的描述也很模糊。
    RshMan
        3
    RshMan  
    OP
       2017-03-20 08:35:47 +08:00
    @thekll tinyproxy 是支持透明代理的,没说可不可以支持 https , http 是可以的,这个问题困扰很久
    la0wei
        4
    la0wei  
       2017-03-22 10:40:26 +08:00
    我用过 privoxy ,不过没有尝试 https 。
    我建议你看 tinyproxy 的日志
    https 通过 http 代理理论上是可以的
    RshMan
        5
    RshMan  
    OP
       2017-03-23 09:18:32 +08:00
    @la0wei 理论上是可以让 443 端口的请求通过 connect 的连接,代理服务器只负责转发,建立起连接 ,但是透明代理使用了 iptables 重定向后,似乎改变了报文,访问 https 就报 ssl 的错误,还是没能搞懂,看日志即使我访问了 https 的网站也没在日志中发现任何 443 端口相关的参数
    ecloud
        6
    ecloud  
       2019-06-06 23:51:19 +08:00
    似乎这个问题还是无解?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2833 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 15:24 · PVG 23:24 · LAX 08:24 · JFK 11:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.