Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 11:45 UTC
caddytls: Debug log on implicit tailscale error (#5041)
Matthew Holt committed
Sep 16, 2022 at 09:42 UTC
258071d857aa8d1524161cb7273f960f24162ce9
1 file changed
+5
-5
modules/caddytls/certmanagers.go
+5
-5
@@ -66,7 +66,9 @@ func (ts Tailscale) canHazCertificate(ctx context.Context, hello *tls.ClientHell
66
status, err := tscert.GetStatus(ctx)
67
if err != nil {
68
if ts.Optional {
69
- return false, nil // ignore error if we don't expect/require it to work anyway
69
+ // ignore error if we don't expect/require it to work anyway, but log it for debugging
70
+ ts.logger.Debug("error getting tailscale status", zap.Error(err), zap.String("server_name", hello.ServerName))
71
+ return false, nil
72
}
73
return false, err
74
}
@@ -80,8 +82,7 @@ func (ts Tailscale) canHazCertificate(ctx context.Context, hello *tls.ClientHell
82
83
// UnmarshalCaddyfile deserializes Caddyfile tokens into ts.
84
//
83
-// ... tailscale
84
-//
85
+// ... tailscale
86
func (Tailscale) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
87
for d.Next() {
88
if d.NextArg() {
@@ -178,8 +179,7 @@ func (hcg HTTPCertGetter) GetCertificate(ctx context.Context, hello *tls.ClientH
179
180
// UnmarshalCaddyfile deserializes Caddyfile tokens into ts.
181
//
181
-// ... http <url>
182
-//
182
+// ... http <url>
183
func (hcg *HTTPCertGetter) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
184
for d.Next() {
185
if !d.NextArg() {