smallnest / gitalk

gitalk for colobu
19 stars 0 forks source link

Go http2 和 h2c #64

Open smallnest opened 6 years ago

smallnest commented 6 years ago

https://colobu.com/2018/09/06/Go-http2-和-h2c/

devin7788 commented 6 years ago

群主,你写的h2c服务器端这个代码编不过的("golang.org/x/net/http2/h2c" 包找不到),我改了了代码,让他编过了。 handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello world") }) h2s := &http2.Server{ // ... } h1s := &http.Server{ Addr: ":8972", Handler: h2c.NewHandler(handler, h2s), } log.Fatal(h1s.ListenAndServe())

bwangelme commented 3 years ago

作者你好,

Chrome 从 58 开始不再用证书的 Common Name 字段校验域名信息,改用 SAN 字段。所以你文中用 $ openssl req -new -key server.key -out server.csr 命令生成的证书无法在 chrome 中使用。

http://blog.ideawand.com/2017/11/22/build-certificate-that-support-Subject-Alternative-Name-SAN/ 这篇文章介绍了如何生成带 SAN 信息的证书。