douyao4632 2016-06-09 18:42
浏览 58

GOlang / https:超时等待客户端前言

I switched SSL on, with ListenAndServeTLS

func main() { serverMux := http.NewServeMux() serverMux.HandleFunc("/v1/ws1", handler1)
 serverMux.HandleFunc("/v1/ws2", handler2) serverMux.HandleFunc("/v1/ws3", handler3)
 serverMux.HandleFunc("/static/", handlerStatic(http.FileServer(http.Dir("/var/project/")))) go func() { wsSSLServer := &http.Server{ Addr: ":443", Handler: serverMux, ReadTimeout: 15 * time.Second, WriteTimeout: 15 * time.Second, } certPath := "/etc/letsencrypt/live/example.com/" fmt.Println(wsSSLServer.ListenAndServeTLS(certPath+"fullchain.pem", certPath+"privkey.pem")) }() wsServer := &http.Server{ Addr: ":80", Handler: serverMux, ReadTimeout: 15 * time.Second, WriteTimeout: 15 * time.Second, } fmt.Println(wsServer.ListenAndServe()) }

and now I get lots of these errors in the logs:

http2: server: error reading preface from client x.x.x.x:xxxxx: timeout waiting for client preface

what does it mean?

  • 写回答

1条回答 默认 最新

  • dtmu88600 2016-07-09 17:20
    关注

    I got the same error using Firefox as the client. Regenerating the SSL key/cert solved the issue, I guess the certificate expired.

    For localhost development: openssl req -nodes -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days XXX -subj '/CN=localhost'

    评论

报告相同问题?

悬赏问题

  • ¥15 touchsocket udp组播
  • ¥20 MAC怎么安装Silverlight 插件?以及安装了怎么启用
  • ¥15 VS2012中查询语句无法填入解析,数值传不进去
  • ¥15 gis系统开发出现命名空间“ESRI.ArcGIS”中不存在类型或命名空间名“Analyst3D”报错
  • ¥15 怎么让ai定时给我发信息 c#或者python
  • ¥15 scrapy的Error
  • ¥15 RBF-VSG姚凤军论文复现问题
  • ¥30 开发一个APP商城在制作tabbar的时候运行不了代码没有检查出错误,但是显示不出tabbar,以下为运行结果,如何解决?
  • ¥15 多网卡服务器中winform如何绑定指定网卡
  • ¥15 关于#python#pandas#的问题,想要实现:多个TXT导入Excel,进行分列,不同txt之间都从第一行开始,请各位专家解答!