cfssl gencert local-issued certificate with local -profile config for expiry does not work. Requires remote cfssl serve service instead.
- Dominant language
- Go
- Stars
- 9.5k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Updating this to a bug report: gencert does not work with a local profile for expiry. Below are the configs used.
---
It does work when the same configuration is used with the remote service (cfssl serve). I used a key generated with the remote service for now.
From the front page readme:
```
Generating a local-issued certificate and private key.
cfssl gencert -ca cert -ca-key key [-hostname=comma,separated,hostnames] csr.json
```
I've tried adding expiry and not_after in multiple places in the csr.json, but have not been able to change the default of 1 year (8760h).
What is the correct csr.json config to do this?
i.e. csr.json:
```
{
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "US",
"L": "Loc",
"O": "org",
"OU": "services",
"ST": "ST"
}
]
}
```
I have also tried using a signing profile like this profile.json
```
{
"auth_keys": {
"key1": {
"key": "xxxxxxxxxxxxxx",
"type": "standard"
}
},
"signing": {
"default": {
"auth_key": "key1",
"expiry": "26280h",
"usages": [
"signing",
"key encipherment",
"server auth",
"client auth"
]
}
}
}
```
And calling/checking it with:
```
cfssl gencert -ca cert -ca-key key -profile=profile.json [-hostname=comma,separated,hostnames] csr.json | cfssl -bare client
openssl x509 -in client.pem -text -noout
```
Contributor guide
Assessment
This issue has not been assessed yet.