go使用websocket遇到dial:x509: certificate signed by unknown authority

websocket.DefaultDialer.Dial(url, headers)

改为

websocket.Dialer{TLSClientConfig: &tls.Config{RootCAs: nil, InsecureSkipVerify: true}}.Dial(url, headers)

忽略证书的校验即可解决

 

posted @ 2018-11-16 11:26  雪山飞猪  阅读(1945)  评论(0编辑  收藏  举报