sameersbn / docker-squid

Dockerfile to create a Docker container image for Squid proxy server
MIT License
822 stars 412 forks source link

Can't get digest authentication working for some reason. #51

Closed eggbean closed 5 years ago

eggbean commented 5 years ago

I've set up squid within docker on a remote server using this docker image and my config file adjustments have worked fine, until I tried enabling digest authentication. It doesn't seem to do anything. I added this to the config file.

auth_param digest program /usr/lib/squid3/digest_file_auth –c /etc/squid/password-file
auth_param digest children 5 startup=0 idle=1
auth_param digest realm Squid Proxy
auth_param digest nonce_garbage_interval 5 minutes
auth_param digest nonce_max_duration 30 minutes
auth_param digest nonce_max_count 50

Then I did this:

$ htdigest -c password-file Squid\ Proxy jason
$ docker cp ~/password-file squid:/etc/squid/
$ docker exec -it squid bash

# chown root:root /etc/squid/password-file
# chmod 400 /etc/squid/password-file
# exit

$ docker kill -s HUP squid

Everything works as before and I am not being asked for a username and password when I connect a browser to the proxy. Previous ACLs have not been changed.

Is there any reason why this wouldn't work in Docker or have I got something wrong?

eggbean commented 5 years ago

I had to add this to make digest authentication work:

acl authenticated proxy_auth REQUIRED 
http_access allow authenticated