/
๐Ÿ“œ

Create local self-signed certificate

Table of contents
  • Use mkcert
  • Use openssl

Use mkcert

github.com/FiloSott...e/mkcert

Install

sh
brew install mkcert
brew install nss
mkcert -install
sh
$ mkcert -install
Created a new local CA at "/Users/zander/Library/Application Support/mkcert" ๐Ÿ’ฅ
The local CA is now installed in the system trust store! โšก๏ธ
The local CA is now installed in the Firefox trust store (requires browser restart)! ๐ŸฆŠ

Run

sh
mkcert localhost 127.0.0.1 ::1
sh
$ mkcert localhost 127.0.0.1 ::1
Using the local CA at "/Users/zander/Library/Application Support/mkcert" โœจ
Created a new certificate valid for the following names ๐Ÿ“œ
- "localhost"
- "127.0.0.1"
- "::1"
The certificate is at "./localhost+2.pem" and the key at "./localhost+2-key.pem" โœ…

This will add the certificate and key into whichever directory you ran the script in

Use openssl

Run this then follow the instructions.

sh
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./server.key -out ./server.crt

This is not nearly as good as mkcert though.

Want to make your own site like this?
Try gatsby-theme-code-notes by Zander Martineau.
Notes on code. My second brain, by Zander Martineau.