Skip to content

Commit ac763e6

Browse files
refactor deprecated field
1 parent e39753f commit ac763e6

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

controllers/cloud.redhat.com/providers/web/caddy_gateway_config.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ func GenerateConfig(hostname string, bopAddress string, whitelist []string, appR
7373

7474
sni := []string{hostname}
7575

76+
caPool := caddytls.FileCAPool{
77+
TrustedCACertPEMFiles: []string{"/cas/ca.pem"},
78+
}
7679
appConfig := caddyhttp.App{
7780
HTTPPort: 8888,
7881
HTTPSPort: 9090,
@@ -93,9 +96,8 @@ func GenerateConfig(hostname string, bopAddress string, whitelist []string, appR
9396
AnyTag: []string{"cert0"},
9497
},
9598
ClientAuthentication: &caddytls.ClientAuthentication{
96-
Mode: "verify_if_given",
97-
TrustedCACertPEMFiles: []string{"/cas/ca.pem"},
98-
},
99+
Mode: "verify_if_given",
100+
CARaw: caddyconfig.JSONModuleObject(caPool, "provider", "file", &warnings)},
99101
}, {}},
100102
Logs: &caddyhttp.ServerLogConfig{
101103
LoggerNames: map[string]caddyhttp.StringArray{"localhost.localdomain": {""}},

controllers/cloud.redhat.com/providers/web/caddy_gateway_config_test.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@
8181
]
8282
},
8383
"client_authentication": {
84-
"trusted_ca_certs_pem_files": [
85-
"/cas/ca.pem"
86-
],
84+
"ca": {
85+
"pem_files": [
86+
"/cas/ca.pem"
87+
],
88+
"provider": "file"
89+
},
8790
"mode": "verify_if_given"
8891
}
8992
},

0 commit comments

Comments
 (0)