summaryrefslogtreecommitdiff
path: root/modules/caddytls/certmanagers.go
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2023-05-15 10:47:30 -0600
committerGitHub <noreply@github.com>2023-05-15 10:47:30 -0600
commit96919acc9d583ef11ea1f9c72a9991fb3f8aab9f (patch)
tree40b6b48bfe159176495c7904190e8098ca24d1ac /modules/caddytls/certmanagers.go
parente96aafe1ca04e30fc10992a77ae08d3a3f3c5f05 (diff)
caddyhttp: Refactor cert Managers (fix #5415) (#5533)
Diffstat (limited to 'modules/caddytls/certmanagers.go')
-rw-r--r--modules/caddytls/certmanagers.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/modules/caddytls/certmanagers.go b/modules/caddytls/certmanagers.go
index 1b701ab..23af19d 100644
--- a/modules/caddytls/certmanagers.go
+++ b/modules/caddytls/certmanagers.go
@@ -23,14 +23,6 @@ func init() {
// Tailscale is a module that can get certificates from the local Tailscale process.
type Tailscale struct {
- // If true, this module will operate in "best-effort" mode and
- // ignore "soft" errors; i.e. try Tailscale, and if it doesn't connect
- // or return a certificate, oh well. Failure to connect to Tailscale
- // results in a no-op instead of an error. Intended for the use case
- // where this module is added implicitly for convenience, even if
- // Tailscale isn't necessarily running.
- Optional bool `json:"optional,omitempty"`
-
logger *zap.Logger
}
@@ -60,16 +52,11 @@ func (ts Tailscale) GetCertificate(ctx context.Context, hello *tls.ClientHelloIn
// canHazCertificate returns true if Tailscale reports it can get a certificate for the given ClientHello.
func (ts Tailscale) canHazCertificate(ctx context.Context, hello *tls.ClientHelloInfo) (bool, error) {
- if ts.Optional && !strings.HasSuffix(strings.ToLower(hello.ServerName), tailscaleDomainAliasEnding) {
+ if !strings.HasSuffix(strings.ToLower(hello.ServerName), tailscaleDomainAliasEnding) {
return false, nil
}
status, err := tscert.GetStatus(ctx)
if err != nil {
- if ts.Optional {
- // 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
}
for _, domain := range status.CertDomains {