Squid SSL透明代理 – SSL_connect:SSLv2 / v3中读取服务器错误hello A.

我试图为我的内部服务器之一设置一个SSL代理,使用Squid访问https://www.googleapis.com ,以使该服务器上的Rails应用程序能够通过代理访问googleapis.com

我是新手,所以我的方法是使用Squid设置SSL透明代理。 我在Ubuntu 12.04上构buildSquid 3.3 ,生成一对ssl key和crt,并configuration这样的squid

 http_port 443 transparent cert=/home/larry/ssl/server.csr key=/home/larry/ssl/server.key 

几乎所有其他configuration都是默认的。 持有key / crt的dir的授权是drwxrwxr-x 2 proxy proxy 4096 Oct 17 15:45 ssl

回到我的开发笔记本电脑上,我把<proxy-server-ip> www.googleapis.com放在我的/etc/hosts以便让电话进入我的代理服务器。

但是当我在我的rails应用程序中尝试它时,我得到:

 SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol 

我也尝试用openssl在cli:

 openssl s_client -state -nbio -connect www.googleapis.com:443 2>&1 | grep "^SSL" SSL_connect:before/connect initialization SSL_connect:SSLv2/v3 write client hello A SSL_connect:error in SSLv2/v3 read server hello A SSL_connect:error in SSLv2/v3 read server hello A 

我在哪里做错了?

这个文件是否真的包含你的证书?

  cert=/home/larry/ssl/server.csr 

如果您遵循标准惯例,那是您发送给SSL供应商的CSR证书签名请求。 作为回报,SSL供应商给了你一个证书(通常是.crt)文件,你需要在这里使用。