刚刚编译鱿鱼3.5.25与:
configure options: '--with-openssl' '--enable-ssl' '--enable-ssl-crtd'
我用openssl创build了.pem文件,在squid.conf中我有:
http_port 3128 ssl-bump cert=/etc/squid3/myCA.pem generate-host-certificates=on dynamic_cert_mem_cache_size=4MB
到目前为止,一切工作正常,HTTP请求加载罚款,我只是得到This Connection is Untrusted消息在Firefox中的https,但我想这是因为我没有创build和添加.der文件到浏览器。
我遇到的问题是,当我尝试使用url_rewrite_program ,我将其添加到squid.conf中:
url_rewrite_program /etc/squid3/rewrite.php
rewrite.php看起来像这样:
#!/usr/bin/php <?php $temp = array(); stream_set_timeout(STDIN, 86400); while ( $input = fgets(STDIN) ) { $temp = split(' ', $input); $output = $temp[0] . "\n"; if( stristr($temp[0], "192.168.0.123" ) == false ) { $output = "302:http://192.168.0.123\n"; } echo $output; }
我redirect一切只是为了testing。 现在,http请求redirect罚款,但https请求显示Unable to connect在Firefox中Unable to connect错误。
squid / cache.log显示:
2017/10/07 23:37:45 kid1| abandoning local=127.0.0.1:3128 remote=127.0.0.1:44497 FD 22 flags=1
鱿鱼/ access.log显示这样的东西:
1507430378.532 0 127.0.0.1 TCP_REDIRECT/302 215 CONNECT www.cloudflare.com:443 - HIER_NONE/- -
如何使用url_rewrite_program使https请求工作?