Getting a free SSL certificate with Cloudflare
Every public website should use HTTPS. It encrypts traffic between the browser and the server, prevents casual monitoring and tampering, and avoids the browser warnings shown for insecure pages.
The technology is now TLS, although people still commonly say SSL certificate. Cloudflare’s Universal SSL gives sites behind its network a free certificate, which makes it a practical option for a small site.
Setting it up
- Create a Cloudflare account and add the site.
- Choose the free plan. It is enough for most personal and small websites.
- Cloudflare will give you two nameservers. Sign in to your domain registrar and replace the current nameservers with these values.
- Open the SSL settings in Cloudflare and choose the appropriate encryption mode.
- Wait for the certificate to become active, then confirm the site loads over
https://.
The encryption mode matters. “Flexible” encrypts traffic only between the visitor and Cloudflare, leaving the connection from Cloudflare to your origin unencrypted. It can be useful when the origin cannot support HTTPS, but I would prefer “Full” or “Full (strict)” when the origin has a certificate. That protects the complete journey rather than only its first half.
After HTTPS works, redirect HTTP requests to HTTPS and check for mixed content such as images or scripts still loaded over http://. The padlock is useful confirmation, but the real goal is an encrypted connection all the way through.
Enjoyed reading this?
If you found this article helpful, consider supporting my writing. Every little bit helps keep this blog going.
Related articles
- Setting Up SSH Keys on Ubuntu 20.04
Create an SSH key on Ubuntu 20.04, copy the public key to a server, test the login, and only then consider disabling passwords.
- Add Custom Headers to Cloudflare Pages
Add response headers to Cloudflare Pages with a _headers file, including security rules and noindex for preview deployments.
- How the SameSite cookie attribute works
How the SameSite cookie attribute controls cross-site requests, including the difference between Strict, Lax, and None.