summaryrefslogtreecommitdiff
path: root/caddytest
diff options
context:
space:
mode:
authorAlban Lecocq <alban@lempire.co>2021-04-29 18:56:01 +0200
committerGitHub <noreply@github.com>2021-04-29 10:56:01 -0600
commitff6ca577ec7196e2cf3991c817d3655754de4b24 (patch)
tree8699774d9adcea7dd3c5d3c4dcbb7a171de57e4a /caddytest
parent90175571698d7cb0e4184d257a425f0bd11c713d (diff)
httpcaddyfile: Fix unexpectedly removed policy (#4128)
* httpcaddyfile: Fix unexpectedly removed policy When user set on_demand tls option in a catch-all (:443) policy, we expect other policies to not have the on_demand enabled See ex in tls_automation_policies_5.txt Btw, we can remove policies if they are **all** empty. * Update caddyconfig/httpcaddyfile/tlsapp.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Diffstat (limited to 'caddytest')
-rw-r--r--caddytest/integration/caddyfile_adapt/tls_automation_policies_5.txt62
1 files changed, 62 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/tls_automation_policies_5.txt b/caddytest/integration/caddyfile_adapt/tls_automation_policies_5.txt
new file mode 100644
index 0000000..87d278d
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/tls_automation_policies_5.txt
@@ -0,0 +1,62 @@
+a.example.com {
+}
+
+b.example.com {
+}
+
+:443 {
+ tls {
+ on_demand
+ }
+}
+----------
+{
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":443"
+ ],
+ "routes": [
+ {
+ "match": [
+ {
+ "host": [
+ "a.example.com"
+ ]
+ }
+ ],
+ "terminal": true
+ },
+ {
+ "match": [
+ {
+ "host": [
+ "b.example.com"
+ ]
+ }
+ ],
+ "terminal": true
+ }
+ ]
+ }
+ }
+ },
+ "tls": {
+ "automation": {
+ "policies": [
+ {
+ "subjects": [
+ "a.example.com",
+ "b.example.com"
+ ]
+ },
+ {
+ "on_demand": true
+ }
+ ]
+ }
+ }
+ }
+} \ No newline at end of file