Skip to content

Commit

Permalink
Added digest auth support to test Apache HTTPD docker imsage
Browse files Browse the repository at this point in the history
  • Loading branch information
ok2c committed Feb 4, 2018
1 parent 4f7df3d commit 1253d7f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion httpclient5-testing/docker/apache-httpd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ COPY httpd.conf ${httpd_home}/conf/
COPY httpd-ssl.conf ${httpd_home}/conf/

RUN mkdir -p ${private_dir}
RUN htpasswd -b -c ${private_dir}/.htpasswd testuser nopassword
# user: testuser; pwd: nopassword
RUN echo "testuser:{SHA}0Ybo2sSKJNARW1aNCrLJ6Lguats=" > ${private_dir}/.htpasswd
RUN echo "testuser:Restricted Files:73deccd22e07066db8c405e5364335f5" > ${private_dir}/.htpasswd_digest
RUN echo "Big Secret" > ${private_dir}/big-secret.txt

EXPOSE 8080
Expand Down
10 changes: 10 additions & 0 deletions httpclient5-testing/docker/apache-httpd/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -577,3 +577,13 @@ SSLRandomSeed connect builtin

</Directory>

<Directory "/var/httpd/www/private">

AuthType Digest
AuthName "Restricted Files"
AuthDigestDomain /
AuthBasicProvider file
AuthUserFile "/var/httpd/www/private/.htpasswd_digest"
Require valid-user

</Directory>

0 comments on commit 1253d7f

Please sign in to comment.