Skip to content

Commit

Permalink
Shorten to _cn, make it actually work lol
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Jan 6, 2022
1 parent 4859f37 commit 1800679
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
14 changes: 7 additions & 7 deletions caddyconfig/httpcaddyfile/pkiapp.go
Expand Up @@ -28,9 +28,9 @@ func init() {
//
// pki {
// ca [<id>] {
// name <name>
// root_common_name <name>
// intermediate_common_name <name>
// name <name>
// root_cn <name>
// intermediate_cn <name>
// }
// }
//
Expand Down Expand Up @@ -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())
Expand Down
Expand Up @@ -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"
}
}
}
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit 1800679

Please sign in to comment.