5

I am trying to develop a proxy server which will help clients to auto logged into my application without password by setting cookies on that session in proxy. It means if user is using proxy to access that site then he will auto logged into that site using cookie set on that traffic.

I already installed & configured SQUID on centos 6.8 x64. After setting everything & using

request_header_add Cookie name=value

in /etc/squid/squid.conf.

The cookie is set to all HTTP traffic but my application uses HTTPS. So, i tried to setup OpenSSl, ssl-bump, and all the setup regarding SSL including ip tables

This is how my squid.conf looks like:

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 70        # gopher
acl Safe_ports port 210        # wais
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 deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow all

http_port 3130

http_port 3128 intercept
https_port 3129 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=8MB cert=/etc/squid/ssl_cert/myca.pem key=/etc/squid/ssl_cert/myca.pem

request_header_add Cookie name=value all

#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 8MB
sslcrtd_children 8 startup=1 idle=1

After researching more i also activate ip tables to forward packets to proxy for intercept.

iptables -t nat -A PREROUTING -p tcp -s 0.0.0.0/0 -j DNAT --to-destination 192.2xx.xx4.xx4:3128 --dport 80

iptables -t nat -A PREROUTING -p tcp -s 0.0.0.0/0 -j DNAT --to-destination 192.2xx.xx4.xx4:3129 --dport 443

Above configuration is working fine without any issue on HTTP traffic But still the Cookie header is not added to "HTTPS" traffic. My main motive is to logged into the application if anyone use this proxy without entering login details using cookie set into HTTPS header.

Can anyone help me to tell that this task can be done to setup cookie (Change header) on HTTPS traffic using SQUID or not.

If possible please help me to find out the error or what else i have to do.

Thanks in advance !

user2890725
  • 88
  • 1
  • 8

0 Answers0