HTTP TLS(SSL) Certificates

Posted on August 25, 2021
Tags: javascript

1 HTTP vs HTTPS

HTTPS linked terms: SSL, Root Authority, Certificate Authority, TLS, 443

2 HTTPS Certificate Authority

2.1 Cert confirm identity

Certificate Authorities validate the identity of the certificate holder(website) for the user(browser)

We want to talk to a website but how do we are not talking to a faker?
A website needs to confirm it’s identity using a Cert.
But how do we know to trust the Cert?
Using Certificate Authorities(CA) like LetsEncrypt

2.2 Cert Signing Request

  • CA public key is pre-installed in most Client browsers
  • CA private key: Every month you may ask let’s encrypt to sign your SSL Cert.

Example CA: LetsEncrypt

Generates a public-private key pair as domain.key
and a Certificate Signing Request domain.csr

openssl req -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr
  1. Validation: is the SSL cert really from the Website?
    Check in authenticity of SSL cert using LetsEncrypt PublicKey
  2. After-Validation: Ok, the cert is legit so it’s safe to take the SSL cert public key
  3. Encrypt: Now I can use the website’s SSL cert public key to encrypt my own(browser) Secret Key
  4. Share Secret Key: I can send this encrypted Secret Key back to the website which the website can decrypt with it’s private key.

3 HTTP/1.1

Sequential

4 HTTP/2

Multiplex(Async) implemented as “SPDY by Google”

5 HTTP/3

6 Practical

Using chrome inspect > Network can find which version of HTML you’re using

7 Websocket

chrome://flags/#allow-insecure-localhost