Skip to content

Commit

Permalink
ipn/ipnlocal: remove ancient transition mechanism for https certs
Browse files Browse the repository at this point in the history
And confusing error message that duplicated the valid cert domains.

Fixes tailscale/corp#15876

Change-Id: I098bc45d83c8d1e0a233dcdf3188869cce66e128
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
  • Loading branch information
bradfitz committed Feb 17, 2024
1 parent 6c3899e commit 794af40
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions ipn/ipnlocal/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,23 +688,8 @@ func checkCertDomain(st *ipnstate.Status, domain string) error {
return nil
}
}
// Transitional way while server doesn't yet populate CertDomains: also permit the client
// attempting Self.DNSName.
okay := st.CertDomains[:len(st.CertDomains):len(st.CertDomains)]
if st.Self != nil {
if v := strings.Trim(st.Self.DNSName, "."); v != "" {
if v == domain {
return nil
}
okay = append(okay, v)
}
}
switch len(okay) {
case 0:
if len(st.CertDomains) == 0 {
return errors.New("your Tailscale account does not support getting TLS certs")
case 1:
return fmt.Errorf("invalid domain %q; only %q is permitted", domain, okay[0])
default:
return fmt.Errorf("invalid domain %q; must be one of %q", domain, okay)
}
return fmt.Errorf("invalid domain %q; must be one of %q", domain, st.CertDomains)
}

0 comments on commit 794af40

Please sign in to comment.