diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-08-09 12:05:47 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-08-09 12:05:47 -0600 |
commit | ab885f07b844fd60adb9d49ed7884f3cd2d939a7 (patch) | |
tree | 8827ad88cf3da8982154e2fda46f53274342785d /modules/caddytls/fileloader.go | |
parent | 4950ce485f7d931890fcfd2ee287b6df1b5db435 (diff) |
Implement config adapters and beginning of Caddyfile adapter
Along with several other changes, such as renaming caddyhttp.ServerRoute
to caddyhttp.Route, exporting some types that were not exported before,
and tweaking the caddytls TLS values to be more consistent.
Notably, we also now disable automatic cert management for names which
already have a cert (manually) loaded into the cache. These names no
longer need to be specified in the "skip_certificates" field of the
automatic HTTPS config, because they will be skipped automatically.
Diffstat (limited to 'modules/caddytls/fileloader.go')
-rw-r--r-- | modules/caddytls/fileloader.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/caddytls/fileloader.go b/modules/caddytls/fileloader.go index 5f277c8..7a0d14d 100644 --- a/modules/caddytls/fileloader.go +++ b/modules/caddytls/fileloader.go @@ -25,12 +25,12 @@ import ( func init() { caddy.RegisterModule(caddy.Module{ Name: "tls.certificates.load_files", - New: func() interface{} { return fileLoader{} }, + New: func() interface{} { return FileLoader{} }, }) } -// fileLoader loads certificates and their associated keys from disk. -type fileLoader []CertKeyFilePair +// FileLoader loads certificates and their associated keys from disk. +type FileLoader []CertKeyFilePair // CertKeyFilePair pairs certificate and key file names along with their // encoding format so that they can be loaded from disk. @@ -42,7 +42,7 @@ type CertKeyFilePair struct { } // LoadCertificates returns the certificates to be loaded by fl. -func (fl fileLoader) LoadCertificates() ([]Certificate, error) { +func (fl FileLoader) LoadCertificates() ([]Certificate, error) { var certs []Certificate for _, pair := range fl { certData, err := ioutil.ReadFile(pair.Certificate) @@ -73,4 +73,4 @@ func (fl fileLoader) LoadCertificates() ([]Certificate, error) { } // Interface guard -var _ CertificateLoader = (fileLoader)(nil) +var _ CertificateLoader = (FileLoader)(nil) |