Skip to content

Instantly share code, notes, and snippets.

@pedrosancao
Last active March 24, 2019 03:12
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 pedrosancao/c42b0a9d2839d6b25066a8e4bdb00f53 to your computer and use it in GitHub Desktop.
Save pedrosancao/c42b0a9d2839d6b25066a8e4bdb00f53 to your computer and use it in GitHub Desktop.
SSL Apache configuration file
# generate CSR for multiple domains:
# https://www.endpoint.com/blog/2014/10/30/openssl-csr-with-alternative-names-one
# configuration for /etc/apache2/conf-available/ssl-params.conf
# full totorial available on
# https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-16-04
# from https://cipherli.st/
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_Apache2.html
<IfModule mod_ssl.c>
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder On
# Disable preloading HSTS for now. You can use the commented out header line that includes
# the "preload" directive if you understand the implications.
#Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains"
Header always set X-Frame-Options DENY
Header always set X-Content-Type-Options nosniff
# Requires Apache >= 2.4
SSLCompression off
SSLUseStapling on
SSLStaplingCache "shmcb:logs/stapling-cache(150000)"
# generated using sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
SSLOpenSSLConfCmd DHParameters "/etc/ssl/certs/dhparam.pem"
# Requires Apache >= 2.4.11
SSLSessionTickets Off
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment