7

I need to run a squid server in order to code and test another program against a proxy. So I downloaded Squid for Windows, configured for running without authentication and everything works. So far so good.

Now I need to setup authentication, and I just need a simple one. First I thought about using the MySQL authentication program - but! I can't find the squid_db_auth compiled for Windows. Does anyone know where to find it, or what other simple authentication do I have for Squid? If I could just configure a login and password that would do the trick.

| improve this question | | | | |
8

I finally figured out this. Squid comes with build in basic authentication, and it is easily configured - when you know how to!

First, you need a htpasswd file to use with ncsa authentication. On Windows, it can be easily created online with this page. I only needed one user called test with the password test, so no problem for me giving that to a third party.

Then I found out, googling different pages, that the following addition to squid.conf does the rest.

# In my squid.conf this is the very first uncommented line.
auth_param basic program c:/squid/libexec/ncsa_auth.exe c:/squid/etc/passwd

# The following needs to be in that order and I placed it right after
# the line 'acl CONNECT method CONNECT'
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

I made no other changes to the default config file.

| improve this answer | | | | |
  • For more recent Squid versions, the helper is called basic_ncsa_auth.exe. – mstrap Jan 18 '17 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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