wakeup
(usa Debian)
Enviado em 12/10/2015 - 23:23h
Olá a todos da comunidade:
Estou a 3 semanas recortando artigos sobre como fazer funcionar o squid com filtro de HTTPS com ssl e o certificado, cheguei a conclusão que isso não funciona. Baseado no site Oficial do Squid, mesmo assim gostaria de saber se alguém tem isso funcionando?
Lembrando que o Squid sobe, porém nao abre paginas HTTPS, apenas se configurar manualmente no Navegador, as outras paginas abrem normalmente, tanto em proxy transparente ou pelo navegador também, o que prova que meu IPTABLES está, por isso nao vou posta-lo aqui.
#############################
# Seguem meus passos:
#############################
apt-get install build-essential fakeroot devscripts gawk gcc-multilib dpatch
apt-get build-dep squid3
apt-get build-dep openssl*
apt-get source squid3
apt-get install openssl* (acrescentado por mim)
~vi squid3-3.1.19/debian/rules
...
DEB_CONFIGURE_EXTRA_FLAGS := --datadir=/usr/share/squid3 \
--sysconfdir=/etc/squid3 \
--mandir=/usr/share/man \
--with-cppunit-basedir=/usr \
--enable-inline \
--enable-ssl \
--enable-ssl-crtd \
...
cd squid3-3.1.19/
debuild -us -uc -b
root@Host-002:~# apt-get install squid-langpack
root@Host-002:~# dpkg -i squid3_3.4.8-6+deb8u1_amd64.deb squid3-common_3.4.8-6+deb8u1_all.deb
/usr/lib/squid3/ssl_crtd -c -s /etc/squid/certs/ssl_db -M 4 MB
chown proxy:proxy /etc/squid/certs/ssl_db
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout squid.pem -out squid.pem
openssl x509 -in squid.pem -outform DER -out squid.der
E também já instalei o squid.der no navegador na parte de autoridades.
##########################
# Segue meu squid3 -v:
##########################
root@Host-002:~# squid3 -v
Squid Cache: Version 3.4.8
Debian linux
configure options: '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=${prefix}/lib/squid3' '--srcdir=.' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' '--datadir=/usr/share/squid3' '--sysconfdir=/etc/squid3' '--mandir=/usr/share/man' '--enable-inline' '--enable-ssl' '--enable-ssl-crtd' '--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,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' '--enable-ecap' '--disable-translation' '--with-swapdir=/var/spool/squid3' '--with-logdir=/var/log/squid3' '--with-pidfile=/var/run/squid3.pid' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--enable-build-info=Debian linux' '--enable-linux-netfilter' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'LDFLAGS=-fPIE -pie -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security'
###########################
# Squid.conf:
###########################
#Access Lists
acl home_network src 172.18.4.0/24
#Ports allowed through Squid
acl Safe_ports port 80 #http
acl Safe_ports port 443 #https
acl Safe_ports port 8443 #https
acl SSL_ports port 443
acl SSL_ports port 8443
acl SSL method CONNECT
acl CONNECT method CONNECT
#allow/deny
http_access allow localhost
http_access allow home_network
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow all
#proxy ports
http_port 172.18.4.2:3128
http_port 172.18.4.2:8080 intercept
http_port 172.18.4.2:8443 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid3/certs/squid.pem
ssl_bump none localhost
sslcrtd_program /usr/lib/squid3/ssl_crtd -s /etc/squid3/certs/ssl_db -M 4MB
ssl_bump server-first all
sslcrtd_children 5
#caching directory
cache_dir ufs /var/cache/squidcache/ 2048 16 128
cache_mem 1024 MB
#refresh patterns for caching static files
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i \.(gif|png|jpg|jpeg|ico)$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.(iso|avi|wav|mp3|mp4|mpeg|swf|flv|x-flv)$ 43200 90% 432000 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.(deb|rpm|exe|zip|tar|tgz|ram|rar|bin|ppt|doc|tiff)$ 10080 90% 43200 override-expire ignore-no-cache ignore-no-store ignore-private
refresh_pattern -i \.index.(html|htm)$ 0 40% 10080
refresh_pattern -i \.(html|htm|css|js)$ 1440 40% 40320
refresh_pattern . 0 40% 40320
#nameservers
dns_nameservers 8.8.8.8
#############################
# Meu netstat
#############################
root@Host-002:~# netstat -na | grep 0.0.0
tcp 0 0 0.0.0.0:111 0.0.0.0:* OUÇA
tcp 0 0 172.18.4.2:8080 0.0.0.0:* OUÇA
tcp 0 0 127.0.0.1:80 0.0.0.0:* OUÇA
tcp 0 0 0.0.0.0:22 0.0.0.0:* OUÇA
tcp 0 0 172.18.4.2:3128 0.0.0.0:* OUÇA
tcp 0 0 127.0.0.1:25 0.0.0.0:* OUÇA
tcp 0 0 172.18.4.2:8443 0.0.0.0:* OUÇA
tcp 0 0 0.0.0.0:56733 0.0.0.0:* OUÇA