[Golang] Build A Simple Web Service part.7 — Learn the SSL/TLS connection

Jen-Hsuan Hsieh (Sean)
A Layman
Published in
7 min readApr 20, 2019

--

Copy right@A layman

As I mentioned in my previous article, I decided to review the basic knowledge instead of learning new frameworks.

In this article, I will introduce:

  • How SSL/TLS connection works.
  • Implement the HTTPS server and the client in Golang.

The overview of SSL/TLS connection

There are several steps to establish a trusted end-to-end communication on Secure Sockets Layer (SSL) connection.

Copy right@A layman

The browser only contains built-in Root CA certification. The server side must install the SSL certification.

  1. First, the client side asks for the SSL connection.
  2. The server generates the signed data.
  3. The server responds with the signed data to the client.
  4. The client will authenticate the SSL certificate and the digital signature.
  5. Finally, the client sends the encrypted session key and encrypted data to the server.

--

--

Jen-Hsuan Hsieh (Sean)
A Layman

Frontend Developer🚀 Angular • React • Nest • Electron • Micro-frontend • Monorepo Architecture • https://daily-learning.herokuapp.com/