Update 20.03.2015: Added link to a sample Apache TLS configuration
Encryption is a vital part of any software handling sensitive information, such as personal details or payment data. Encryption makes sure only those authorized to see the information transmitted across the open network get to see it. To quote Edward Snowden:
Encryption works. Properly implemented strong crypto systems are one of the few things that you can rely on. Unfortunately, endpoint security is so terrifically weak that NSA can frequently find ways around it.
So encryption needs two things, good algorithms and proper configuration. Encryption is more often defeated by finding a way around the encryption than breaking it. Our sample case is TLS used in web servers.
We have grown to rely on a few open source libraries for our encryption needs, such as OpenSSL and GPG. OpenSSL has lately suffered from several vulnerabilities, which make the protected information potentially open for malicious hackers to access.
On the other hand, increased publicity on security issues has made us increasingly aware of the vulnerability of these critical crypto libraries. OpenSSL has finally been able to secure funding for proper developer resources, and project called LibreSSL forked OpenSSL “with goals of modernizing the codebase, improving security, and applying best practice development processes”.
TLS is hard
Encryption is quite hard to use properly. The best algorithms or libraries do you no good, if endpoint configuration is not utilizing them the right way. Ordering TLS certificate and configuring your web server requires substantial amount of security knowledge, which is amusingly detailed in this Andy Wingo’s blog post.
I set on the task to configure my web server properly. It turns out there’s not that much good quality configurations available for nginx, so I decided to share the results on a sample configuration for nginx available at Github for configuring and using TLS encryption with a virtual host. The configuration disables broken ciphers and protocols, and configures nginx according to today’s best practices.
For comparison, here’s also an excellent Apache TLS configuration by @PetriKoistinen. Note, that this configuration disables TLS1.0. You need to enable it to support Internet Explorer <11 among other things.
Increasing awareness of security issues frequently invalidates yesterdays best practices, so it’s also a good idea to frequently scan your site for vulnerabilities with tools like https://www.ssllabs.com/ssltest/ and https://ssl-tools.net/webservers. Also take a look at https://cipherli.st/ for encryption configuration on many other server software.