From 1fe090dbfd5b48a020f436d92735f718762fdd9d Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Sat, 13 Aug 2016 22:50:24 +0800 Subject: [PATCH] Verfiy Domain correctly --- transport/internet/ws/dialer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transport/internet/ws/dialer.go b/transport/internet/ws/dialer.go index bb1e88b0e..480ec82e2 100644 --- a/transport/internet/ws/dialer.go +++ b/transport/internet/ws/dialer.go @@ -1,6 +1,7 @@ package ws import ( + "crypto/tls" "fmt" "net" @@ -48,7 +49,9 @@ func wsDial(src v2net.Address, dest v2net.Destination) (*wsconn, error) { return internet.DialToDest(src, dest) } - dialer := websocket.Dialer{NetDial: commonDial, ReadBufferSize: 65536, WriteBufferSize: 65536} + tlsconf := &tls.Config{ServerName: dest.Address().Domain()} + + dialer := websocket.Dialer{NetDial: commonDial, ReadBufferSize: 65536, WriteBufferSize: 65536, TLSClientConfig: tlsconf} effpto := func(dst v2net.Destination) string {