LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-09-2009, 08:10 AM   #1
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Rep: Reputation: 30
squid https


I have not compiled squid with SSL nor installed an SSL certificate on my server yet all https requests are working correctly.
Does squid just pass these on?
In the logs it looks like it is doing this:
1249824051.113 141276 86.xxx.xxx.xxx TCP_MISS/200 15206 CONNECT ssl.gstatic.com:443 demo_1 DIRECT/209.xx.xxx.xxx -

Last edited by qwertyjjj; 08-09-2009 at 08:24 AM.
 
Old 08-10-2009, 02:43 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
That's fine. You are not doing any SSL in squid there, just passing through a connection. SSL would be to stop the SSL, inspect the data inside the connection, and then create a new ssl connection upstream to the destination.
 
Old 08-10-2009, 03:00 AM   #3
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
That's fine. You are not doing any SSL in squid there, just passing through a connection. SSL would be to stop the SSL, inspect the data inside the connection, and then create a new ssl connection upstream to the destination.
Can proxies do that?
I though the whole point of SSL was that it was encrypted all the way to destination?

Do I still need to keep port 443 open for this though?
I assume the browser just directs SSL traffic to port 3128?

Last edited by qwertyjjj; 08-10-2009 at 03:51 AM.
 
Old 08-10-2009, 03:56 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
In line with our previous discussions about transparent proxies, the CONNECT method is the way that a browser asks a proxy to pass a connection through to a destination serverort. There is no inspection / knowledge of SSL at all, indeed many different protocols can use CONNECT methods to get a connection, e.g you could use PuTTY to get an SSH session through a proxy by also explicitly requesting a CONNECT to myserver.com:22 and such - if you do look at your squid.conf you'll hopefully see though that CONNECT is only permitted by the default ACL's on ports 443 and 563, i.e. known ports for valid SSL traffic. So here there is a very small plain text HTTP request made to the proxy, the proxy responds, opens a TCP connection with the destination and then acknowledges to the client that that connection is available. once it does the proxy will blindly pass all data through, data which it can't understand as it's not HTTP any more, and has no interest in.

If you're interested, install wireshark on your client and then watch what actually does happen when you connect to an HTTPS site. That will make it also much clearer why you can't do it transparently, because it actually behaves significantly different when a proxy is involved.
 
Old 08-10-2009, 03:59 AM   #5
qwertyjjj
Senior Member
 
Registered: Jul 2009
Location: UK
Distribution: Cent OS5 with Plesk
Posts: 1,013

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by acid_kewpie View Post
In line with our previous discussions about transparent proxies, the CONNECT method is the way that a browser asks a proxy to pass a connection through to a destination serverort. There is no inspection / knowledge of SSL at all, indeed many different protocols can use CONNECT methods to get a connection, e.g you could use PuTTY to get an SSH session through a proxy by also explicitly requesting a CONNECT to myserver.com:22 and such - if you do look at your squid.conf you'll hopefully see though that CONNECT is only permitted by the default ACL's on ports 443 and 563, i.e. known ports for valid SSL traffic. So here there is a very small plain text HTTP request made to the proxy, the proxy responds, opens a TCP connection with the destination and then acknowledges to the client that that connection is available. once it does the proxy will blindly pass all data through, data which it can't understand as it's not HTTP any more, and has no interest in.

If you're interested, install wireshark on your client and then watch what actually does happen when you connect to an HTTPS site. That will make it also much clearer why you can't do it transparently, because it actually behaves significantly different when a proxy is involved.
So, incoming, I only need port 3128 open and or a forwarding rule from port 80 or 8080.
Outgoing, I need port 80 and 443 open to the proxy can pass on a 443 request?
 
Old 08-10-2009, 05:53 AM   #6
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
Ideally, you'd make all requests to a proxy on port 3128, just one port. Outbound it would be all ports that you class as valid. By default this would be 80 and 443, but could be others, eg. 8080 if you have known reasons for this.
 
  


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
squid with https marcusaurelius Linux - Security 18 08-08-2009 06:59 AM
Squid: Everything working but HTTPS EricTRA Linux - Server 10 07-29-2009 01:50 AM
https with Squid marcusaureliusbrutus Linux - Server 4 04-28-2009 06:03 AM
Squid and https sites 2buck56 Linux - Security 6 06-14-2007 03:06 AM
Squid and HTTPS AdamG Linux - Security 0 08-07-2003 01:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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