Skip to content

Instantly share code, notes, and snippets.

@bmw
Last active January 31, 2020 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmw/048511815860f63bfee8d2420ec119ca to your computer and use it in GitHub Desktop.
Save bmw/048511815860f63bfee8d2420ec119ca to your computer and use it in GitHub Desktop.
FROM centos:7
RUN yum install httpd mod_ssl openssl -y
WORKDIR /etc/httpd
# Change SSLProtocol setting in default SSL vhost to "all" in default SSL vhost
RUN sed -i 's/SSLProtocol.*/SSLProtocol all/' conf.d/ssl.conf
# Create a different self-signed cert to help see which vhost is used
RUN openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -subj "/CN=example.com" -keyout key.pem -out cert.pem
# Add a TLS1.2 only vhost
RUN echo -e "\
<IfModule mod_ssl.c>\n\
<VirtualHost *:443>\n\
ServerName example.com\n\
SSLCertificateFile cert.pem\n\
SSLCertificateKeyFile key.pem\n\
SSLEngine on\n\
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1\n\
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384\n\
SSLHonorCipherOrder off\n\
SSLOptions +StrictRequire\n\
</VirtualHost>\n\
</IfModule>" >> /etc/httpd/conf/httpd.conf
ENTRYPOINT ["httpd", "-DFOREGROUND"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment