From 1800679fdb72d5eb97bbf0be5c16f56ab053a867 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 5 Jan 2022 22:34:40 -0500 Subject: [PATCH] Shorten to `_cn`, make it actually work lol --- caddyconfig/httpcaddyfile/pkiapp.go | 14 +++++++------- .../global_options_skip_install_trust.txt | 16 ++++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/caddyconfig/httpcaddyfile/pkiapp.go b/caddyconfig/httpcaddyfile/pkiapp.go index 3c24f2b7923..b1aac75fafb 100644 --- a/caddyconfig/httpcaddyfile/pkiapp.go +++ b/caddyconfig/httpcaddyfile/pkiapp.go @@ -28,9 +28,9 @@ func init() { // // pki { // ca [] { -// name -// root_common_name -// intermediate_common_name +// name +// root_cn +// intermediate_cn // } // } // @@ -62,17 +62,17 @@ func parsePKIApp(d *caddyfile.Dispenser, existingVal interface{}) (interface{}, } pkiCa.Name = d.Val() - case "root_common_name": + case "root_cn": if !d.NextArg() { return nil, d.ArgErr() } - pkiCa.Name = d.Val() + pkiCa.RootCommonName = d.Val() - case "intermediate_common_name": + case "intermediate_cn": if !d.NextArg() { return nil, d.ArgErr() } - pkiCa.Name = d.Val() + pkiCa.IntermediateCommonName = d.Val() default: return nil, d.Errf("unrecognized pki ca option '%s'", d.Val()) diff --git a/caddytest/integration/caddyfile_adapt/global_options_skip_install_trust.txt b/caddytest/integration/caddyfile_adapt/global_options_skip_install_trust.txt index d0b46c9afbc..39c118ff8ac 100644 --- a/caddytest/integration/caddyfile_adapt/global_options_skip_install_trust.txt +++ b/caddytest/integration/caddyfile_adapt/global_options_skip_install_trust.txt @@ -3,13 +3,13 @@ pki { ca { name "Local" - root_common_name "Custom Local Root Name" - intermediate_common_name "Custom Local Intermediate Name" + root_cn "Custom Local Root Name" + intermediate_cn "Custom Local Intermediate Name" } ca foo { name "Foo" - root_common_name "Custom Foo Root Name" - intermediate_common_name "Custom Foo Intermediate Name" + root_cn "Custom Foo Root Name" + intermediate_cn "Custom Foo Intermediate Name" } } } @@ -109,11 +109,15 @@ acme-bar.example.com { "install_trust": false }, "foo": { - "name": "Custom Foo Intermediate Name", + "name": "Foo", + "root_common_name": "Custom Foo Root Name", + "intermediate_common_name": "Custom Foo Intermediate Name", "install_trust": false }, "local": { - "name": "Custom Local Intermediate Name", + "name": "Local", + "root_common_name": "Custom Local Root Name", + "intermediate_common_name": "Custom Local Intermediate Name", "install_trust": false } }