Files
tailscale/tsnet/maybe_acme.go
Fredrik Fornwall 3a72a686cb tsnet: fix ts_omit_acme build
Gate certificate fetching on ACME support and return an error when omitted.

Fixes #22250

Change-Id: I709928f1fe11b7f20cc854d299175ca3048c037e
Signed-off-by: Fredrik Fornwall <[email protected]>
2026-11-08 13:47:45 -08:00

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)
}