无法通过鱿鱼代理连接到HTTPS网站

我刚刚尝试在CentOS7上的OpenVZ VPS上创build代理服务器。 所有的好,但我不能访问https网站,如谷歌,instagram,脸谱等。它说,超时,花了很长的时间来回应。

我已经生成了一个myCA.pem证书,并使用ssl_bump我已经链接签署的证书没有错误(与systemctl status squid检查),现在所有当我试图连接到上面的网站枚举它给了我没有互联网错误:

1 http://i.prntscr.com/9c443500cf84450cb128b7a52e858cf7.png

下面是我的squid.conf和这里我的cache.log http://pastebin.com/MUkujTig

 acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow all http_port 3128 ssl-bump \ generate-host-certificates=on \ dynamic_cert_mem_cache_size=4MB \ key=/etc/squid/ssl_cert/myCA.pem \ cert=/etc/squid/ssl_cert/myCA.pem # SSL Bump Config always_direct allow all ssl_bump server-first all sslproxy_cert_error deny all sslproxy_flags DONT_VERIFY_PEER sslcrtd_program /usr/lib64/squid/ssl_crtd -s /var/lib/ssl_db -M 4MB sslcrtd_children 8 startup=1 idle=1 hierarchy_stoplist cgi-bin ? coredump_dir /var/spool/squid cache deny all refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern . 0 20% 4320 icp_port 3130 forwarded_for off request_header_access Allow allow all request_header_access Authorization allow all request_header_access Proxy-Authorization allow all request_header_access Proxy-Authenticate allow all request_header_access Cache-Control allow all request_header_access Content-Encoding allow all request_header_access Content-Length allow all 

我已经使用firewall-cmd在公共区域添加了3128端口

对于我的目的,它不需要使用sslbump所以我已经删除它,并通过在squid.conf中添加此行来解决它dns_v4_first on

你login有以下行:

  (ssl_crtd): Failed to initialize /var/lib/ssl_db/index.txt file for writing 

这意味着你的sslbumpconfiguration中有错误。

你的configuration存在的问题是你不能把/var/lib/ssl_db作为你的sslbump存储,因为你不能用/usr/lib64/squid/ssl_crtd -c -s /var/lib/ssl_db 。 在发出命令之前, ssl_db dir不存在,否则将失败。 但是由于权限的缘故, squid用户无法在/var/lib创build目录。 因此,您需要通过执行以下命令(以root身份启动)将该目录更改为/var/lib/squid/ssl_db

  1. sudo su (或任何其他的意思是得到root shell)
  2. mkdir /var/lib/squid/
  3. chown -R squid:squid /var/lib/squid/
  4. su -l squid -s /bin/bash (下一个命令应该作为squid用户运行,所以这一步很重要)
  5. /usr/lib64/squid/ssl_crtd -c -s /var/lib/squid/ssl_db

如果你是成功的,输出应该显示:

  Initialization SSL db... Done 

现在你把squid.conf改成新的ssl_db目录:

 sslcrtd_program /usr/lib64/squid/ssl_crtd -s /var/lib/squid/ssl_db -M 4MB 

而这个指令应该从新的一行开始,你的configuration文件中有一个错误:

 sslcrtd_children 8 startup=1 idle=1 

我希望这将有助于(除非你正在做一些审查,那么我希望它不会:))!

PS这不是你的情况,但我会补充:

不同的发行版将ssl_crtd命令放在不同的目录中,但是人们倾向于先复制configuration文件而不检查其存在。 作为squid用户启动/usr/lib64/squid/ssl_crtd应显示:

 Uninitialized SSL certificate database directory: . To initialize, run "ssl_crtd -c -s ". 

如果说command not foundcommand not found ,那么ssl_crtd可能实际上位于/usr/libexec/squid/ssl_crtd

PPS经过两个小时的Skype会议试图解决不可修复的解决scheme被发现 – 禁用ipv6,托pipe提供商错误地configuration:)

谁会想到,这一切都将崩溃到以下命令:

  sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1 sysctl -w net.ipv6.conf.lo.disable_ipv6 = 1 

并补充说:

  dns_v4_first on 

进入squid.conf