Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to block HTTPS sites using Linux Squid server. How can I do this?

share|improve this question
Not enough information. Please elaborate. How does your network connect to the internet? Are you behind a firewall? – Shadur Apr 3 '11 at 9:58

You want to block any and all HTTPS sites? You need to do this with a firewall on your router. Blocking it in Squid won't prevent people from circumventing it unless the firewall on your router also blocks it. If your router blocks it than what squid does is irrelevant. Better yet, set the firewall to block all outgoing TCP connections except for port 80 for pretty decent control of your network. If your simply looking for a way to control who can use HTTPS, then it makes sense to use squid. You can set up a firewall rule so only Squid has HTTPS and require anyone else to go through Squid with the hope that they might get HTTPS. Regardless, any kind of true filtering will require cooperation with the router on your network.

Now, if you do want to use Squid to help regulate HTTPS, you want to control who has access to the HTTP CONNECT method. HTTP CONNECT is nothing more than a simple way to tunnel through a proxy server like Squid. Squid has no real control and cannot participate in any kind of caching or modification of a SSL/TLS connection such as HTTPS outside of controlling which hosts and ports it can connect to. This is done through the acl and http_access directives inside squid.conf. Look at your local squid.conf file for some examples and basic documentation. Beyond that, get familiar with the standard Squid documentation that is already provided for you.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.