Skip to content

Commit

Permalink
cmd/tailscale: disable HTTPS verification for QNAP auth.
Browse files Browse the repository at this point in the history
QNAP's "Force HTTPS" mode redirects even localhost HTTP to
HTTPS, but uses a self-signed certificate which fails
verification. We accommodate this by disabling checking
of the cert.

Fixes #6903

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
  • Loading branch information
DentonGentry committed Jan 8, 2023
1 parent be67b8e commit 17393e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/tailscale/cli/web.go
Expand Up @@ -247,7 +247,13 @@ func qnapAuthnSid(r *http.Request, user, sid string) (string, *qnapAuthResponse,
}

func qnapAuthnFinish(user, url string) (string, *qnapAuthResponse, error) {
resp, err := http.Get(url)
// QNAP Force HTTPS mode uses a self-signed certificate.
// https://github.com/tailscale/tailscale/issues/6903
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
resp, err := client.Get(url)
if err != nil {
return "", nil, err
}
Expand Down

0 comments on commit 17393e0

Please sign in to comment.