Using HTTPS
In Chapter 6, Cryptography, we walked you through the steps necessary to generate keys and then create your own self-signed certificate. We also gave you an example of how to run a TCP socket-level TLS server. This section will demonstrate how to create a TLS-encrypted HTTP server or an HTTPS server.
TLS is the newer version of SSL, and Go has a standard package that supports it well. You need a private key and the signed certificate generated with that key. You can use a self-signed certificate or one signed by a recognized certificate authority. Historically, SSL certs signed by a trusted authority always cost money, but https://letsencrypt.org/ changed the game when they began offering free and automated certificates signed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access