HTTPS/TLS
When you are developing a web application, it is important to know how to secure your information in transit. This is achieved by using a Transport Layer Security Protocol, commonly known as TLS. The standard Go library provides a TLS implementation under the crypto/tls
package. The TLS protocol ensures:
Identity: Provides both client and server identification using digital certificates.
Integrity: Makes sure that data is not tampered with in transit by calculating a message digest.
Authentication: Both client and server can be required to be authenticated using Public-Key Cryptography.
Confidentiality: The message is encrypted during transit, thus protecting it from any unintended recipient.
In the following topic, we'll see how to use certificates to encrypt traffic between a client and a server.
The first step to encrypting traffic between a client and a server is to generate a digital certificate.
In the next exercise, we will generate a self...