From 66ce0c5c635c4ff254ccb92123711534b6461b35 Mon Sep 17 00:00:00 2001 From: Yannick Ihmels Date: Mon, 9 Jan 2023 21:18:12 +0100 Subject: [PATCH] caddytls: Add test cases for Caddyfile `tls` options (#5293) --- .../caddyfile_adapt/tls_dns_ttl.txt | 12 ++- .../tls_explicit_issuer_dns_ttl.txt | 81 +++++++++++++++++++ ...s_explicit_issuer_propagation_options.txt} | 0 .../tls_propagation_options.txt | 79 ++++++++++++++++++ 4 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 caddytest/integration/caddyfile_adapt/tls_explicit_issuer_dns_ttl.txt rename caddytest/integration/caddyfile_adapt/{tls_propagation_timeout.txt => tls_explicit_issuer_propagation_options.txt} (100%) create mode 100644 caddytest/integration/caddyfile_adapt/tls_propagation_options.txt diff --git a/caddytest/integration/caddyfile_adapt/tls_dns_ttl.txt b/caddytest/integration/caddyfile_adapt/tls_dns_ttl.txt index b1b2941c..02e46763 100644 --- a/caddytest/integration/caddyfile_adapt/tls_dns_ttl.txt +++ b/caddytest/integration/caddyfile_adapt/tls_dns_ttl.txt @@ -2,9 +2,7 @@ localhost respond "hello from localhost" tls { - issuer acme { - dns_ttl 5m10s - } + dns_ttl 5m10s } ---------- { @@ -60,6 +58,14 @@ tls { } }, "module": "acme" + }, + { + "challenges": { + "dns": { + "ttl": 310000000000 + } + }, + "module": "zerossl" } ] } diff --git a/caddytest/integration/caddyfile_adapt/tls_explicit_issuer_dns_ttl.txt b/caddytest/integration/caddyfile_adapt/tls_explicit_issuer_dns_ttl.txt new file mode 100644 index 00000000..53629e3a --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/tls_explicit_issuer_dns_ttl.txt @@ -0,0 +1,81 @@ +localhost + +respond "hello from localhost" +tls { + issuer acme { + dns_ttl 5m10s + } + issuer zerossl { + dns_ttl 10m20s + } +} +---------- +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":443" + ], + "routes": [ + { + "match": [ + { + "host": [ + "localhost" + ] + } + ], + "handle": [ + { + "handler": "subroute", + "routes": [ + { + "handle": [ + { + "body": "hello from localhost", + "handler": "static_response" + } + ] + } + ] + } + ], + "terminal": true + } + ] + } + } + }, + "tls": { + "automation": { + "policies": [ + { + "subjects": [ + "localhost" + ], + "issuers": [ + { + "challenges": { + "dns": { + "ttl": 310000000000 + } + }, + "module": "acme" + }, + { + "challenges": { + "dns": { + "ttl": 620000000000 + } + }, + "module": "zerossl" + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/caddytest/integration/caddyfile_adapt/tls_propagation_timeout.txt b/caddytest/integration/caddyfile_adapt/tls_explicit_issuer_propagation_options.txt similarity index 100% rename from caddytest/integration/caddyfile_adapt/tls_propagation_timeout.txt rename to caddytest/integration/caddyfile_adapt/tls_explicit_issuer_propagation_options.txt diff --git a/caddytest/integration/caddyfile_adapt/tls_propagation_options.txt b/caddytest/integration/caddyfile_adapt/tls_propagation_options.txt new file mode 100644 index 00000000..ee4666b6 --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/tls_propagation_options.txt @@ -0,0 +1,79 @@ +localhost + +respond "hello from localhost" +tls { + propagation_delay 5m10s + propagation_timeout 10m20s +} +---------- +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":443" + ], + "routes": [ + { + "match": [ + { + "host": [ + "localhost" + ] + } + ], + "handle": [ + { + "handler": "subroute", + "routes": [ + { + "handle": [ + { + "body": "hello from localhost", + "handler": "static_response" + } + ] + } + ] + } + ], + "terminal": true + } + ] + } + } + }, + "tls": { + "automation": { + "policies": [ + { + "subjects": [ + "localhost" + ], + "issuers": [ + { + "challenges": { + "dns": { + "propagation_delay": 310000000000, + "propagation_timeout": 620000000000 + } + }, + "module": "acme" + }, + { + "challenges": { + "dns": { + "propagation_delay": 310000000000, + "propagation_timeout": 620000000000 + } + }, + "module": "zerossl" + } + ] + } + ] + } + } + } +} \ No newline at end of file