Skip to content

Latest commit

Β 

History

History
52 lines (38 loc) Β· 1.13 KB

File metadata and controls

52 lines (38 loc) Β· 1.13 KB

Hello LocalHttps

Install mkcert

On macOS, use Homebrew.

brew install mkcert
brew install nss # if you use Firefox

build from source (requires Go 1.10+)

go get -u github.com/FiloSottile/mkcert
$(go env GOPATH)/bin/mkcert

mkcert is a simple tool for making locally-trusted development certificates. It requires no configuration.

$ mkcert -install
Created a new local CA at "/Users/filippo/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 restart)! 🦊

$ mkcert  localhost 127.0.0.1 ::1 dev.test.local
Using the local CA at "/Users/filippo/Library/Application Support/mkcert" ✨

Created a new certificate valid for the following names πŸ“œ
 - "localhost"
 - "127.0.0.1"
 - "::1"
 - "dev.test.local"

Test go with https server on localhost

	err := http.ListenAndServeTLS(":4433", "localhost+3.pem", "localhost+3-key.pem", nil)
	if err != nil {
		log.Fatal("ListenAndServe: ", err)
	}
go run https-server.go

Open LocalHttps on chrome

mkcert