kyk's blog

Setup https for react development

Installation

$ brew install mkcert
$ brew install nss

Generate cert


$ cd ~
$ mkcert -install
$ mkcert localhost 127.0.0.1

Use cert

in .bashrc define

export SSL_CRT_FILE=~/localhost+1.pem
export SSL_KEY_FILE=~/localhost+1-key.pem

start react with

HTTPS=true yarn start