Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
reverseproxy: Fix casing of RootCAPEMFiles
Matthew Holt committed
Jan 22, 2020 at 09:35 UTC
6b6cd934d02476e3d71b85edbb0acf58cf299fec
1 file changed
+3
-3
modules/caddyhttp/reverseproxy/httptransport.go
+3
-3
@@ -178,7 +178,7 @@ func (h HTTPTransport) Cleanup() error {
178
type TLSConfig struct {
179
RootCAPool []string `json:"root_ca_pool,omitempty"`
180
// Added to the same pool as above, but brought in from files
181
- RootCAPemFiles []string `json:"root_ca_pem_files,omitempty"`
181
+ RootCAPEMFiles []string `json:"root_ca_pem_files,omitempty"`
182
// TODO: Should the client cert+key config use caddytls.CertificateLoader modules?
183
ClientCertificateFile string `json:"client_certificate_file,omitempty"`
184
ClientCertificateKeyFile string `json:"client_certificate_key_file,omitempty"`
@@ -208,7 +208,7 @@ func (t TLSConfig) MakeTLSClientConfig() (*tls.Config, error) {
208
}
209
210
// trusted root CAs
211
- if len(t.RootCAPool) > 0 || len(t.RootCAPemFiles) > 0 {
211
+ if len(t.RootCAPool) > 0 || len(t.RootCAPEMFiles) > 0 {
212
rootPool := x509.NewCertPool()
213
for _, encodedCACert := range t.RootCAPool {
214
caCert, err := decodeBase64DERCert(encodedCACert)
@@ -217,7 +217,7 @@ func (t TLSConfig) MakeTLSClientConfig() (*tls.Config, error) {
217
}
218
rootPool.AddCert(caCert)
219
}
220
- for _, pemFile := range t.RootCAPemFiles {
220
+ for _, pemFile := range t.RootCAPEMFiles {
221
pemData, err := ioutil.ReadFile(pemFile)
222
if err != nil {
223
return nil, fmt.Errorf("failed reading ca cert: %v", err)