|
@@ -6,6 +6,7 @@ import (
|
|
metrics "github.com/rcrowley/go-metrics"
|
|
metrics "github.com/rcrowley/go-metrics"
|
|
"io/ioutil"
|
|
"io/ioutil"
|
|
"math"
|
|
"math"
|
|
|
|
+ "net"
|
|
"ngrok/client/mvc"
|
|
"ngrok/client/mvc"
|
|
"ngrok/conn"
|
|
"ngrok/conn"
|
|
"ngrok/log"
|
|
"ngrok/log"
|
|
@@ -113,10 +114,23 @@ func newClientModel(config *Configuration, ctl mvc.Controller) *ClientModel {
|
|
|
|
|
|
// configure TLS SNI
|
|
// configure TLS SNI
|
|
m.tlsConfig.ServerName = serverName(m.serverAddr)
|
|
m.tlsConfig.ServerName = serverName(m.serverAddr)
|
|
|
|
+ m.tlsConfig.InsecureSkipVerify = useInsecureSkipVerify()
|
|
|
|
|
|
return m
|
|
return m
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// server name in release builds is the host part of the server address
|
|
|
|
+func serverName(addr string) string {
|
|
|
|
+ host, _, err := net.SplitHostPort(addr)
|
|
|
|
+
|
|
|
|
+ // should never panic because the config parser calls SplitHostPort first
|
|
|
|
+ if err != nil {
|
|
|
|
+ panic(err)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return host
|
|
|
|
+}
|
|
|
|
+
|
|
// mvc.State interface
|
|
// mvc.State interface
|
|
func (c ClientModel) GetProtocols() []proto.Protocol { return c.protocols }
|
|
func (c ClientModel) GetProtocols() []proto.Protocol { return c.protocols }
|
|
func (c ClientModel) GetClientVersion() string { return version.MajorMinor() }
|
|
func (c ClientModel) GetClientVersion() string { return version.MajorMinor() }
|