Skip to content

Instantly share code, notes, and snippets.

@frankdors
Created January 3, 2022 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankdors/c3dd66b9ef534b7a326cc50d5610c440 to your computer and use it in GitHub Desktop.
Save frankdors/c3dd66b9ef534b7a326cc50d5610c440 to your computer and use it in GitHub Desktop.
Certificado HTTPS Self-signed (para localhost ou rede local)

Criar Certificado (Linux)

Em subjectAltName coloque seus Host e IPs desejados

openssl req -x509 -days 18250 -out server.crt -keyout server.key \
-newkey rsa:2048 -nodes -sha256 -extensions EXT -subj '/CN=server' \
-config <(printf "[dn]\nCN=server\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost,DNS:franciel-pc,IP:10.1.1.5,IP:10.1.1.118\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth\nbasicConstraints=CA:TRUE")

Reference: https://letsencrypt.org/pt-br/docs/certificates-for-localhost/

Configurar certificado (no servidor)

  • CertificateFile = server.crt
  • CertificateKeyFile = server.key

Instalar certificado (em cada dispositivo cliente)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment