acme
acme copied to clipboard
golang ListenAndServeTLS
func main() {
http.HandleFunc("/do", func(w http.ResponseWriter, r *http.Request) {
fmt.Println( "do")
})
err := http.ListenAndServeTLS(":9000", "key.pem", "cert.pem", nil)
if err != nil {
panic(err)
}
}
1# using browser open https://localhost:9000/do 2# browser remind "not safe connection:NET::ERR_CERT_AUTHORITY_INVALID" 3# how to handle this except importing the ca cert in client?