只是不起作用,对吧?
Firefox安装后的.pem
文件,但其他应用程序不工作。
将.pem
文件转换为.crt
# openssl x509 -outform der -in myCA.pem -out myCA.crt
并将其安装为certlm
中的可信根认证自动测试,但仍有许多东西无法工作: Outlook、Team、GoogleDrive、.
发布于 2020-10-21 12:17:53
这似乎很不可靠。
这是让Squid工作的配置(来自https://elatov.github.io/2019/01/using-squid-to-proxy-ssl-sites/)。我不知道为什么-我只是运气好。
acl step1 at_step SslBump1
ssl_bump peek step1
ssl_bump bump all
ssl_bump splice all
使用
浏览器中的
.pem
作为授权,.crt
在Windows中作为受信任的根证书颁发机构。对于例外情况,最好的方法是从一开始就不把它们发送给Squid。使用在-d
命令中带有域名的iptables
标志,只需在命令执行时将其解析为IP地址,因此最好维护iptables
可以引用的ipset
。
下面是我用文本文件中的域维护我的ipset
的脚本。其想法是,这可以作为一个cron
作业运行,以获取新域并将映射更新到IP地址。
#!/bin/sh
## Bypass Squid
ipset -L no-proxy >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Creating ipset: no-proxy."
ipset create no-proxy hash:ip
fi
ipset flush no-proxy
if [ -f "/etc/squid/no-proxy-iptables.txt" ]; then
for domain in $(cat /etc/squid/no-proxy-iptables.txt); do
for address in $( dig a $domain +short | grep -P -e '^(\d{1,3}\.){3}\d{1,3}$' ); do
echo $domain " -> " $address
ipset add no-proxy $address
done
done
else
echo "File doess not exist: /etc/squid/no-proxy-iptables.txt"
fi
这是我的防火墙脚本:
#!/bin/sh
iptables -t nat -F
iptables -t mangle -F
iptables -F # Does NOT flush everything! Hence the other three commands.
iptables -X
# Squid: exceptions
ipset -L no-proxy >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Using ipset: no-proxy."
iptables -t nat -A PREROUTING -i br0 -m set --match-set no-proxy dst -j ACCEPT
fi
# Squid: HTTP
iptables -t nat -A PREROUTING -i br0 -p tcp --dport 80 -j DNAT --to 192.168.1.31:3128
iptables -t nat -A PREROUTING -i br0 -p tcp --dport 80 -j REDIRECT --to-port 3128
# Squid: HTTPS
iptables -t nat -A PREROUTING -i br0 -p tcp --dport 443 -j DNAT --to 192.168.1.31:3129
iptables -t nat -A PREROUTING -i br0 -p tcp --dport 443 -j REDIRECT --to-port 3129
# IP masquerade
iptables -A FORWARD -o wlan0 -i br0 -s 192.168.1.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o enp0s6f1u2 -j MASQUERADE
# echo 1 > /proc/sys/net/ipv4/ip_forward
iptables-save > /etc/iptables/rules.v4
通过监视浏览器开发工具中的网络选项卡,您似乎能够很好地猜测应该绕过哪些域。
https://stackoverflow.com/questions/64460173
复制