mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-13 06:07:34 +00:00
net/tshttpproxy: use http as the scheme for proxies
Currently we try to use `https://` when we see `https_host`, however that doesn't work and results in errors like `Received error: fetch control key: Get "https://controlplane.tailscale.com/key?v=32": proxyconnect tcp: tls: first record does not look like a TLS handshake` This indiciates that we are trying to do a HTTPS request to a HTTP server. Googling suggests that the standard is to use `http` regardless of `https` or `http` proxy Updates #4395, #2605 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -96,15 +96,15 @@ func parseSynologyConfig(r io.Reader) (*url.URL, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
proxyURL := new(url.URL)
|
||||
proxyURL := &url.URL{
|
||||
Scheme: "http", // regardless of proxy type
|
||||
}
|
||||
if cfg["auth_enabled"] == "yes" {
|
||||
proxyURL.User = url.UserPassword(cfg["proxy_user"], cfg["proxy_pwd"])
|
||||
}
|
||||
|
||||
proxyURL.Scheme = "https"
|
||||
host, port := cfg["https_host"], cfg["https_port"]
|
||||
if host == "" {
|
||||
proxyURL.Scheme = "http"
|
||||
host, port = cfg["http_host"], cfg["http_port"]
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user