LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-09-2013, 06:29 AM   #1
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Rep: Reputation: Disabled
how to deal with https with squid3 proxy


Greetings

I am facing an issue here and i am a bit confused.

I have setup a web proxy server using squid3. All works well apart from the fact that https pages cannot be displayed. After some googling i found out that in order to proxy https request you have to do some sort of MiTM implementation which is too much fuzz.

Is there a way to just forward the https requests to their destination without any interferance by squid3?

I mean, how does all other web proxies in the world deal with this https issue?

Thanks
 
Old 10-09-2013, 06:49 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
What you appear to want is the default behaviour for squid:

http://wiki.squid-cache.org/SquidFaq/ConfiguringSquid

the entry
Code:
http_access deny CONNECT !SSL_ports
says that if you are not on an SSL port, ie..g 443 by default, then you can not use the HTTP CONNECT method, which is how a client requests HTTPS access to a remote site explicitly from a proxy. The later line
Code:
http_access allow localnet
would then permit that access if you ARE requesting a CONNECT on port 443 from an IP address defined in the localnet ACL.

The most likely reason that springs to mind for why you might be having trouble is if you're trying to use squid transparently? If so, it's much much harder, hence the mitm stuff. Don't do it transparently if you can avoid it.

Last edited by acid_kewpie; 10-09-2013 at 06:51 AM.
 
1 members found this post helpful.
Old 10-10-2013, 03:27 AM   #3
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
What you appear to want is the default behaviour for squid:

http://wiki.squid-cache.org/SquidFaq/ConfiguringSquid

the entry
Code:
http_access deny CONNECT !SSL_ports
says that if you are not on an SSL port, ie..g 443 by default, then you can not use the HTTP CONNECT method, which is how a client requests HTTPS access to a remote site explicitly from a proxy. The later line
Code:
http_access allow localnet
would then permit that access if you ARE requesting a CONNECT on port 443 from an IP address defined in the localnet ACL.

The most likely reason that springs to mind for why you might be having trouble is if you're trying to use squid transparently? If so, it's much much harder, hence the mitm stuff. Don't do it transparently if you can avoid it.
Thanks for acid

I do get your point .. but what i am thinking to do is slightly more complecated, i wouldnt mind a tough solution but at least i am trying to find one.


i have:

---------------LAN-----------------

---------------------------------------------------------------------
| clients|---------->|Mikrotik|----------->| Linux-Squid sever|
---------------------------------------------------------------------



Mikrotik works as the gateway and as trasparent proxy for the clients. It is configured to use the Linux-squid as a proxy.

My problem is that squid does the content filtering hence if i set Mikrotik to bypass https and not forward connections the i will lose the content filtering on the https pages .

Any help would be really much appriciated!

Last edited by tripialos; 10-10-2013 at 03:47 AM.
 
Old 10-10-2013, 04:02 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well there's the "t" word as feared... but you have... two proxies here? Whatever the router can do it transparent but squid is not? That sounds messy. is the router proxying? or just redirecting the raw TCP traffic?

Ditch transparency and everything will get MUCH easier and nicer and simpler. If you have issues about configuring clients to explicitly use a proxy, then there are plenty of centralised options available like a proxy.pac or wpad.dat file hosted on an internal web server.
 
Old 10-10-2013, 06:11 AM   #5
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
Well there's the "t" word as feared... but you have... two proxies here? Whatever the router can do it transparent but squid is not? That sounds messy. is the router proxying? or just redirecting the raw TCP traffic?

Ditch transparency and everything will get MUCH easier and nicer and simpler. If you have issues about configuring clients to explicitly use a proxy, then there are plenty of centralised options available like a proxy.pac or wpad.dat file hosted on an internal web server.
The router and the clients are on the same lan..the Linux Squid proxy is on the WAN.
Yes the router is configured to proxy with the Squid proxy as its parent. The reason i used the router (appart from the fact that it performs the hotspot functions) is so i can do the proxying transparently ... I mean how could i provide trasparent proxying if my proxy is outside the LAN where the clients reside ?

So, i proxy all the traffic from the LAN towards the squid server and from there i do content filtering but if i set the router to bypass the https then i dont have content filtering.

Now i am thinking of it again...there isnt any solution to this... isnt it?
 
Old 10-10-2013, 06:20 AM   #6
cospengle
Member
 
Registered: Feb 2008
Location: Armidale, NSW, Australia
Distribution: Fedora 8
Posts: 32

Rep: Reputation: 6
Quote:
Originally Posted by tripialos View Post
...there isnt any solution to this... isnt it?
No there isn't. If you want to analyse the content of HTTPS traffic, you must be able to decrypt it - which of course involves proxying the SSL component (MITM).
 
Old 10-10-2013, 06:28 AM   #7
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cospengle View Post
No there isn't. If you want to analyse the content of HTTPS traffic, you must be able to decrypt it - which of course involves proxying the SSL component (MITM).
Well .. i am not actually going to do anything with the content, its just that squid uses blacklists in order to block specific pages
 
Old 10-10-2013, 08:53 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Yes there is a solution. Stop doing things transparently. Or do an ugly MITM thing. They are both genuine solutions.

You ARE doing things with the content, HTTP headers ARE content here.
 
1 members found this post helpful.
Old 10-10-2013, 09:11 AM   #9
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
Yes there is a solution. Stop doing things transparently. Or do an ugly MITM thing. They are both genuine solutions.

You ARE doing things with the content, HTTP headers ARE content here.
Yes you are right...I assume you mean configure the clients to use the squid proxy correct?
 
Old 10-10-2013, 09:57 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by tripialos View Post
Yes you are right...I assume you mean configure the clients to use the squid proxy correct?
yes, but as above there are ways to simplify this considerably if you have a lot of clients.
 
Old 10-11-2013, 01:46 AM   #11
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
yes, but as above there are ways to simplify this considerably if you have a lot of clients.
Thanks for the "consulting" acid_kewpie!
 
  


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] Unable to block HTTPS squid3 ozid Linux - Networking 3 07-25-2013 02:33 AM
Squid3 Proxy esigande Linux - Newbie 13 12-20-2011 02:02 AM
transparent proxy with squid3 proxy help wanted to get it working keevill Linux - Newbie 11 02-21-2011 02:59 AM
Can't See https pages with Squid3 pliqui Linux - Networking 16 04-13-2009 04:05 PM
Totally messed up with squid3 as transparent proxy PATRINOS06 Linux - Networking 2 10-12-2008 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:18 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