我正在编写一个特殊的flutter应用程序,想要设置httpclient
的tls连接,例如在golang DialTLS
或android java sslsocketfactory
我找到了文档,其中提到httpclient
可以使用SecurityContext
作为参数,但是我需要为tls连接指定httpclient
。如何设置httpclient的SecuritySocket
//golang
client := http.Client{
Transport: &http.Transport{
DialTLS: func(network, addr string) (conn net.Conn, e error) {
conf := &tls.Config{
InsecureSkipVerify: true,
VerifyPeerCertificate: func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {
return nil
},
}
fmt.Print(s)
return tls.Dial("tcp", "", conf)
},//This is the property I want to set in dart's httpclient
},
}