Recent versions of Chrome / IE9 / Firefox work fine. IE8 complains that the page could not be displayed, and it seems that the connection is interrupted. Here is a quick test code.
package main
import (
"time"
"fmt"
"net/http"
)
type Handler struct {
}
func (this *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %q", r.URL.Path)
}
func main() {
handler := &Handler{}
ss := &http.Server{
Addr: ":443",
Handler: handler,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
MaxHeaderBytes: 1 << 20,
}
ss.ListenAndServeTLS("cert.pem", "key.pem")
}
Note that "cert.pem" and "key.pem" are generated by "crypto / tls / generate_cert.go". I tried a real certificate and it didn't work either.
source
share