5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-09-19 16:09:36 +00:00
This commit is contained in:
Neil Alexander 2021-08-01 21:39:49 +01:00
parent bbdff033ce
commit d1cd671bec

View File

@ -103,8 +103,8 @@ func (l *links) call(u *url.URL, sintf string) error {
// the host-port combo from the query option and then seeing if it parses to an
// IP address successfully or not.
if sni := u.Query().Get("sni"); sni != "" {
if host, _, err := net.SplitHostPort(sni); err == nil && net.ParseIP(host) == nil {
tcpOpts.tlsSNI = host
if net.ParseIP(sni) == nil {
tcpOpts.tlsSNI = sni
}
}
// If the SNI is not configured still because the above failed then we'll try