mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
Gate certificate fetching on ACME support and return an error when omitted. Fixes #22250 Change-Id: I709928f1fe11b7f20cc854d299175ca3048c037e Signed-off-by: Fredrik Fornwall <[email protected]>
26 lines
632 B
Go
26 lines
632 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build !js && !ts_omit_acme
|
|
|
|
package tsnet
|
|
|
|
// Link in the ACME/TLS-cert feature so [Server.CertDomains],
|
|
// [Server.ListenTLS], and related cert-fetch paths work out of the box.
|
|
// Build with the ts_omit_acme tag to omit it.
|
|
|
|
import (
|
|
"crypto/tls"
|
|
|
|
_ "tailscale.com/feature/acme"
|
|
)
|
|
|
|
// getCert is the GetCertificate function used by ListenTLS and ListenFunnel.
|
|
func (s *Server) getCert(hi *tls.ClientHelloInfo) (*tls.Certificate, error) {
|
|
lc, err := s.LocalClient()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return lc.GetCertificate(hi)
|
|
}
|