https - squid ssl-bump 3.5.4:错误-协商FD 10上的SSL连接时出现错误:成功(0)

标签 https proxy ssl-certificate squid man-in-the-middle

我正在尝试安装squid 3.5.4(在docker上运行debian 8)并以ssl-bump模式运行。
汇编:

./configure --prefix=/opt/squid --srcdir=. --disable-maintainer-mode \
--disable-dependency-tracking --disable-silent-rules --enable-inline\
--disable-arch-native --enable-async-io=8 \
--enable-storeio=ufs,aufs,diskd,rock \
--enable-removal-policies=lru,heap --enable-delay-pools \
--enable-cache-digests --enable-icap-client \
--enable-follow-x-forwarded-for \
--enable-auth-basic=DB,fake,getpwnam,LDAP,MSNT-multi-domain,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB \
--enable-auth-digest=file,LDAP \
--enable-auth-negotiate=kerberos,wrapper \
--enable-auth-ntlm=fake,smb_lm \
--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,unix_group,wbinfo_group \
--enable-url-rewrite-helpers=fake --enable-eui \
 --enable-esi --enable-icmp --enable-zph-qos \
--disable-translation --with-filedescriptors=65536 \
--with-large-files --with-default-user=squid \
--enable-linux-netfilter \
CFLAGS="-g -O2 -fPIE -Wall" LDFLAGS="-fPIE -pie -Wl,-z,relro -Wl,-z,now" CPPFLAGS="-D_FORTIFY_SOURCE=2" \
CXXFLAGS="-g -O2 -fPIE " --enable-ssl --with-openssl --enable-ssl-crtd


更改的配置(squid.conf)(默认为其余):

# Squid normally listens to port 3128 \
http_port 9090
sslcrtd_program /opt/squid/libexec/ssl_crtd -s /opt/squid/var/lib/ssl_db -M 4MB
https_port 8080 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB key=/opt/squid/certs/private.pem cert=/opt/squid/certs/public.pem

### New configuration for Squid version 3.5
acl step1 at_step SslBump1
ssl_bump peek step1
ssl_bump bump all
### New config ends
sslproxy_capath /etc/ssl/certs
sslproxy_cert_error allow all
always_direct allow all
sslproxy_flags DONT_VERIFY_PEER


生成的证书:

openssl req -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout private.pem -out public.pem


生成鱿鱼证书目录并更改所有权:

/opt/squid/libexec/ssl_crtd -c -s /opt/squid/var/lib/ssl_db -M 4MB
chown -R squid:squid /opt/squid/var/lib/ssl_db


CA Root证书位于默认路径中

squid@525f5d9c759a:/opt/squid/certs$ ls -lsthr  /etc/ssl/certs | wc -l
741


我正在使用HTTP CONNECT测试该配置,直接在浏览器中配置代理。


问题:


当浏览器请求命中代理时,出现以下错误

8zjv9ksCWknblqfZ3rjWczvKNRboHpu940olZAbvSP0JWSXhFfRRTIsHIHD2/rt/
n5/qsURq/WLodLffFxuk+bLVTDZu
-----END PRIVATE KEY-----

2015/05/04 15:13:46.468 kid1| client_side.cc(3981) sslCrtdHandleReply: Certificate for 172.17.0.7 was successfully recieved from ssl_crtd
2015/05/04 15:13:46.468 kid1| client_side.cc(3664) httpsCreate: will negotate SSL on local=172.17.0.7:2222 remote=172.17.42.1:40686 FD 10 flags=33
2015/05/04 15:13:46.468 kid1| AsyncCall.cc(26) AsyncCall: The AsyncCall ConnStateData::requestTimeout constructed, this=0x7f0357a16c10 [call105]


2015/05/04 15:13:46.468 kid1 |协商FD 10上的SSL连接时出错:成功(0)

2015/05/04 15:13:46.468 kid1| AsyncCall.cc(93) ScheduleCall: comm.cc(730) will call ConnStateData::connStateClosed(FD -1, data=0x7f03575d43b8) [call95]
2015/05/04 15:13:46.468 kid1| AsyncCallQueue.cc(55) fireNext: entering ConnStateData::connStateClosed(FD -1, data=0x7f03575d43b8)
2015/05/04 15:13:46.468 kid1| AsyncCall.cc(38) make: make call ConnStateData::connStateClosed [call95]
2015/05/05 10:00:25| pinger: Initialising ICMP pinger ...
2015/05/05 10:00:25|  icmp_sock: (1) Operation not permitted
2015/05/05 10:00:25| pinger: Unable to start ICMP pinger.
2015/05/05 10:00:25|  icmp_sock: (1) Operation not permitted
2015/05/05 10:00:25| pinger: Unable to start ICMPv6 pinger.
2015/05/05 10:00:25| FATAL: pinger: Unable to open any ICMP sockets.


发送curl请求显示如下:

curl --proxy https://localhost:8080 -w '\n' https://google.com -v
* Rebuilt URL to: https://google.com/
*   Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
* Establish HTTP proxy tunnel to google.com:443
> CONNECT google.com:443 HTTP/1.1
> Host: google.com:443
> User-Agent: curl/7.42.0
> Proxy-Connection: Keep-Alive
> 
* Proxy CONNECT aborted
* Connection #0 to host localhost left intact

curl: (56) Proxy CONNECT aborted


有人能帮忙吗?

最佳答案

在Squid邮件列表中得到了答复:

http://squid-web-proxy-cache.1019090.n4.nabble.com/Error-negotiating-SSL-connection-on-FD-12-Success-td4671090.html

简介:使用http_port处理来自浏览器的请求,这些浏览器直接指定了代理信息。
将https_port与ssl-bump以及相应的标签“ intercept”或“ tproxy”一起使用,以在透明模式下使用。

关于https - squid ssl-bump 3.5.4:错误-协商FD 10上的SSL连接时出现错误:成功(0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30057104/

相关文章:

ssl - 用于加密的端口列表

WCF - 通过 HTTPS 使用 SOAP 服务 - 请求超时

jakarta-ee - $Proxy$_$$_Weld$EnterpriseProxy$ 代理子类是如何实现的?

ubuntu - 使用 NGINX 作为 Postgres 代理的超时问题

c# - 如何通过代码更改代理服务器

ssl - 是否可以在单个 SSL 证书的第二个标签中使用带有 `*` 的 SAN 条目的通配符

java - Spring Boot 使用 SSL 连接到 Postgresql

internet-explorer - HTTPS 安全性受到 (null) 的损害 - 是什么原因造成的?

java - 尝试分块上传

ssl-certificate - 无法绑定(bind) TCP 端口 443 LetsEncrypt