caddytls: remove ClientHelloSNICtxKey (#6326)

This commit is contained in:
Will Norris 2024-05-18 19:47:46 -07:00 committed by GitHub
parent 9ba999141b
commit 1fc151faec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,9 +22,6 @@ func init() {
caddy.RegisterModule(HTTPCertGetter{}) caddy.RegisterModule(HTTPCertGetter{})
} }
// For referencing the requested SNI server name.
const ClientHelloSNICtxKey caddy.CtxKey = "client_hello_sni"
// Tailscale is a module that can get certificates from the local Tailscale process. // Tailscale is a module that can get certificates from the local Tailscale process.
type Tailscale struct { type Tailscale struct {
logger *zap.Logger logger *zap.Logger
@ -44,7 +41,6 @@ func (ts *Tailscale) Provision(ctx caddy.Context) error {
} }
func (ts Tailscale) GetCertificate(ctx context.Context, hello *tls.ClientHelloInfo) (*tls.Certificate, error) { func (ts Tailscale) GetCertificate(ctx context.Context, hello *tls.ClientHelloInfo) (*tls.Certificate, error) {
ctx = context.WithValue(ctx, ClientHelloSNICtxKey, hello.ServerName)
canGetCert, err := ts.canHazCertificate(ctx, hello) canGetCert, err := ts.canHazCertificate(ctx, hello)
if err == nil && !canGetCert { if err == nil && !canGetCert {
return nil, nil // pass-thru: Tailscale can't offer a cert for this name return nil, nil // pass-thru: Tailscale can't offer a cert for this name