summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-09-12 17:31:54 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-09-12 17:31:54 -0600
commited40a5dcab80f17d63c3fba83349004eac3c7930 (patch)
treee94e2be4f98316529da9a29be6e0b7075c0e1bb0 /modules
parent7799554baacbb7ca2b80f2a22968cfcd8071ab0a (diff)
tls: Do away with SetDefaults which did nothing useful
CertMagic uses the same defaults for us
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/caddyhttp.go1
-rw-r--r--modules/caddytls/acmemanager.go24
-rw-r--r--modules/caddytls/tls.go4
3 files changed, 1 insertions, 28 deletions
diff --git a/modules/caddyhttp/caddyhttp.go b/modules/caddyhttp/caddyhttp.go
index 693f416..b6a8148 100644
--- a/modules/caddyhttp/caddyhttp.go
+++ b/modules/caddyhttp/caddyhttp.go
@@ -337,7 +337,6 @@ func (app *App) automaticHTTPS() error {
},
},
}
- acmeManager.SetDefaults()
tlsApp.Automation.Policies = append(tlsApp.Automation.Policies,
caddytls.AutomationPolicy{
Hosts: domainsForCerts,
diff --git a/modules/caddytls/acmemanager.go b/modules/caddytls/acmemanager.go
index b717268..0482ce3 100644
--- a/modules/caddytls/acmemanager.go
+++ b/modules/caddytls/acmemanager.go
@@ -91,33 +91,9 @@ func (m *ACMEManagerMaker) Provision(ctx caddy.Context) error {
m.Storage = nil // allow GC to deallocate - TODO: Does this help?
}
- m.SetDefaults()
-
return nil
}
-// SetDefaults sets necessary values that are
-// currently empty to their default values.
-func (m *ACMEManagerMaker) SetDefaults() {
- // TODO: Setting all these defaults might not be necessary
- // since CertMagic should fill them in for us...
- if m.CA == "" {
- m.CA = certmagic.Default.CA
- }
- if m.Email == "" {
- m.Email = certmagic.Default.Email
- }
- if m.RenewAhead == 0 {
- m.RenewAhead = caddy.Duration(certmagic.Default.RenewDurationBefore)
- }
- if m.keyType == "" {
- m.keyType = certmagic.Default.KeyType
- }
- if m.storage == nil {
- m.storage = certmagic.Default.Storage
- }
-}
-
// makeCertMagicConfig converts m into a certmagic.Config, because
// this is a special case where the default manager is the certmagic
// Config and not a separate manager.
diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go
index 93a05be..bbcf61e 100644
--- a/modules/caddytls/tls.go
+++ b/modules/caddytls/tls.go
@@ -197,9 +197,7 @@ func (t *TLS) getAutomationPolicyForName(name string) AutomationPolicy {
}
// default automation policy
- mgmt := new(ACMEManagerMaker)
- mgmt.SetDefaults()
- return AutomationPolicy{Management: mgmt}
+ return AutomationPolicy{Management: new(ACMEManagerMaker)}
}
// CertificatesWithSAN returns the list of all certificates