Skip to content

Commit

Permalink
caddytls: Debug log on implicit tailscale error (#5041)
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Sep 16, 2022
1 parent b6cec37 commit 258071d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/caddytls/certmanagers.go
Expand Up @@ -66,7 +66,9 @@ func (ts Tailscale) canHazCertificate(ctx context.Context, hello *tls.ClientHell
status, err := tscert.GetStatus(ctx)
if err != nil {
if ts.Optional {
return false, nil // ignore error if we don't expect/require it to work anyway
// ignore error if we don't expect/require it to work anyway, but log it for debugging
ts.logger.Debug("error getting tailscale status", zap.Error(err), zap.String("server_name", hello.ServerName))
return false, nil
}
return false, err
}
Expand All @@ -80,8 +82,7 @@ func (ts Tailscale) canHazCertificate(ctx context.Context, hello *tls.ClientHell

// UnmarshalCaddyfile deserializes Caddyfile tokens into ts.
//
// ... tailscale
//
// ... tailscale
func (Tailscale) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
for d.Next() {
if d.NextArg() {
Expand Down Expand Up @@ -178,8 +179,7 @@ func (hcg HTTPCertGetter) GetCertificate(ctx context.Context, hello *tls.ClientH

// UnmarshalCaddyfile deserializes Caddyfile tokens into ts.
//
// ... http <url>
//
// ... http <url>
func (hcg *HTTPCertGetter) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
for d.Next() {
if !d.NextArg() {
Expand Down

0 comments on commit 258071d

Please sign in to comment.