gencert with -initca ignores most config arguments
- Dominant language
- Go
- Stars
- 9.5k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
### Context
Creating a certificate authority using a two-tier key heirarchy. Root here is used ONLY to generate a new CA, and is stored in a 'secure' location *under my bed*
### Usage
`cfssl gencert -initca -profile intermediate -config config.json -ca root.pem -ca-key root-key.pem ca-csr.json`
### Expected outcome:
Generates a new CA certificate signed by the Root certificate, which includes the options specified by the profile "intermediate" in `config.json`
### Actual outcome:
Generates a basic self signed certificate as if no options were specified.
### Workaround 1
Generate and sign the certificate as two separate steps i.e.
`cfssl gencert -initca csr.json | cfssljson -bare ca`
`cfssl sign -profile intermediate -config config.json ...`
### Workaround 2
Including
```
"ca_constraint": {
"is_ca": true
}
```
in the config.json profile for a certificate has a similar outcome.
### Notes
This can be confusing to understand, especially considering the documentation makes no mention of keys invalidating other keys. In this case, I was unaware that my config options were being ignored until inspected the certificate directly. Would be handy to have a warning if arguments are discarded.
Thanks! :)
Contributor guide
Assessment
This issue has not been assessed yet.