LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-22-2015, 11:15 PM   #1
nguyenducnam
LQ Newbie
 
Registered: Aug 2015
Posts: 1

Rep: Reputation: Disabled
Is there any way to cache https requests in a proxy server?


(Poor english wish people sympathetic)

Squid server: OS slackware 14.1,kernel 3.10.7, Squid v 3.4.10.

Gaming needs,IE non squid, chrome and firefox run through squid, picture:

http://i.imgur.com/Rt02Erc.jpg

./config squid:

Code:
...................
  --with-openssl \
  --enable-icap-client\
  --enable-ssl\
  --enable-ssl-crtd\
  --enable-snmp \
  --enable-auth \
  --enable-auth-basic \
  --enable-linux-netfilter \
  --enable-async-io \
  --enable-storeio=ufs,aufs,diskd,rock \
  --enable-removal-policies=lru,heap \
  --disable-ipv6\
  --build=$ARCH-slackware-linux \
  --disable-strict-error-checking
file squid.conf:

Code:
......
# Squid normally listens to port 3128
http_port 3129
http_port 3128 intercept
https_port 3127 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/ssl_certs/myCA.pem

# Bump all requests except those originating from

always_direct allow all
ssl_bump none localhost
ssl_bump server-first all
sslproxy_cert_error deny all
sslproxy_flags DONT_VERIFY_PEER


# OPTIONS RELATING TO EXTERNAL SSL_CRTD 

sslcrtd_program /usr/libexec/ssl_crtd -s /var/log/squid/lib/ssl_db -M 4MB
sslcrtd_children 32 startup=5 idle=1

..........................
Load kernel iptables v 1.4.20,file rc.local:

Code:
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

/sbin/modprobe iptable_nat
/sbin/sysctl -w net.ipv4.ip_forward=1
/sbin/sysctl -w net.ipv4.conf.all.send_redirects=1
/sbin/sysctl -w net.ipv4.conf.all.accept_redirects=1
/sbin/sysctl -w net.ipv4.conf.all.secure_redirects=1
/sbin/sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1
#/sbin/sysctl -w net.ipv4.conf.default.rp_filter = 0
#/sbin/sysctl -w net.ipv4.conf.default.accept_source_route = 0


if [ -x /etc/rc.d/rc.squid ]; then
/etc/rc.d/rc.squid start
fi
file rc.firewall:

Code:
#!/bin/sh
#
# /etc/rc.d/rc.firewall

iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 3127
iptables -I INPUT -p tcp -m tcp --dport 3128 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 3127 -j ACCEPT
Configuring chrome browser :Right click Google Chrome shortcut->Select "Properties"->Target->add to end of line" --proxy-server=192.168.1.150:3129" or " --proxy-server=192.168.1.151:3129". To not affect Internet Explorer

Did not know I wrong?
He does know please just help, thank you

Last edited by nguyenducnam; 08-23-2015 at 02:09 AM.
 
Old 08-23-2015, 04:57 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
The way I do this at home:

I control the DHCP service. It is the dhcpd which is running on my Slackware server.
My Slackware server runs a proxy (tinyproxy, but squid works just the same).
The Slackware server also acts like a network router (I have un-commented the line "/usr/sbin/routed -g -s" in the script /etc/rc.d/rc.inet2).
I have an internet router with address 192.168.0.1, all traffic that does not need to use my proxy goes straight through this Netgear box to the internet. I configured the DHCP server to give those clients "192.168.0.1" as the default gateway.
So far so good.

The Slackware server also has its default gateway set to "192.168.0.1" and naturally it is using a fixed IP address... it is a server. The IP address of the server is 192.168.0.2.
Clients that need to use my proxy are configured in /etc/dhcpd.conf so that they get the IP address of the server (192.168.0.2) as the default gateway. A client which is configured that way, sends all its network traffic to my server. On the server, I have iptables rules that transparently re-route traffic on ports 80 (http) and 443 (https) to the port where the proxy is listening (3128). The proxy can be chained to a content filter but that is optional and won't work for the encrypted HTTPS traffic anyway. Traffic will then be forwarded to the Internet when it exits the proxy.

I wrote an article about this setup long ago, perhaps it is still of value for you: http://alien.slackbook.org/dokuwiki/...lackware:proxy

Last edited by Alien Bob; 08-23-2015 at 04:59 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Squid as child proxy and cannot service HTTPS requests gqqnbig Linux - Server 7 07-28-2013 09:53 PM
Logging requests selectively in proxy server. Nitin Chaudhary Linux - Newbie 0 06-13-2012 02:11 AM
cache proxy server pbsenthil Linux - Newbie 5 12-19-2009 02:18 AM
linux Proxy server and https sites blocking Ammad Linux - Server 1 08-19-2009 10:26 PM
redirect all http requests to a different squid proxy server r2d2#jedi Linux - Networking 1 05-27-2009 12:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration