summaryrefslogtreecommitdiff
path: root/modules/caddytls/tls.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-06-24 12:16:10 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-06-24 12:16:10 -0600
commit38677aaa58eb76a416fa42146956f3e3a5981e75 (patch)
treea782a862b7e552d1bdaeebf3514b75392a06f4b4 /modules/caddytls/tls.go
parentd49f762f6d9cdc2e92e8de40f0b0e99a9d0c4fc9 (diff)
caddytls: Support tags for manually-loaded certificates
Diffstat (limited to 'modules/caddytls/tls.go')
-rw-r--r--modules/caddytls/tls.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go
index 63bc21d..7f5b1e9 100644
--- a/modules/caddytls/tls.go
+++ b/modules/caddytls/tls.go
@@ -98,7 +98,7 @@ func (t *TLS) Start() error {
Storage: t.ctx.Storage(),
})
for _, cert := range certs {
- err := magic.CacheUnmanagedTLSCertificate(cert)
+ err := magic.CacheUnmanagedTLSCertificate(cert.Certificate, cert.Tags)
if err != nil {
return fmt.Errorf("caching unmanaged certificate: %v", err)
}
@@ -182,8 +182,16 @@ func (t *TLS) getAutomationPolicyForName(name string) AutomationPolicy {
}
// CertificateLoader is a type that can load certificates.
+// Certificates can optionally be associated with tags.
type CertificateLoader interface {
- LoadCertificates() ([]tls.Certificate, error)
+ LoadCertificates() ([]Certificate, error)
+}
+
+// Certificate is a TLS certificate, optionally
+// associated with arbitrary tags.
+type Certificate struct {
+ tls.Certificate
+ Tags []string
}
// AutomationConfig designates configuration for the