summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/replacer_test.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-06-11 16:19:07 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-06-11 16:19:07 -0600
commitd55c3b31ebb77df65cc052dbddc137cbe07b297e (patch)
tree21c711b6eafb9c05fedc63317fd96e4c7d326c6c /modules/caddyhttp/replacer_test.go
parentb3bff13f7d3635c5c51f71b9e4598d71deab4585 (diff)
caddyhttp: Add client cert SAN placeholders
Diffstat (limited to 'modules/caddyhttp/replacer_test.go')
-rw-r--r--modules/caddyhttp/replacer_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/caddyhttp/replacer_test.go b/modules/caddyhttp/replacer_test.go
index ea9fa65..bc18c5a 100644
--- a/modules/caddyhttp/replacer_test.go
+++ b/modules/caddyhttp/replacer_test.go
@@ -147,6 +147,26 @@ eqp31wM9il1n+guTNyxJd+FzVAH+hCZE5K+tCgVDdVFUlDEHHbS/wqb2PSIoouLV
input: "{http.request.tls.client.subject}",
expect: "CN=client.localdomain",
},
+ {
+ input: "{http.request.tls.client.san.dns_names}",
+ expect: "[localhost]",
+ },
+ {
+ input: "{http.request.tls.client.san.dns_names.0}",
+ expect: "localhost",
+ },
+ {
+ input: "{http.request.tls.client.san.dns_names.1}",
+ expect: "<empty>",
+ },
+ {
+ input: "{http.request.tls.client.san.ips}",
+ expect: "[127.0.0.1]",
+ },
+ {
+ input: "{http.request.tls.client.san.ips.0}",
+ expect: "127.0.0.1",
+ },
} {
actual := repl.ReplaceAll(tc.input, "<empty>")
if actual != tc.expect {