Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

gencert with -initca ignores most config arguments

Open
#1,253 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
cli, security

Research direction

Reproduce the cfssl gencert -initca command with -profile, -config, -ca, and -ca-key, then trace the initca argument-handling and certificate-generation paths. Done means the intermediate profile is applied to the generated CA, or ignored options produce a clear warning; inspect the resulting certificate to verify the behavior.

Written by the indexing model from the issue text.

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! :)

Dominant language
Go
Stars
9.5k
Forks
1.2k
Avg merge
12h 48m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cfssl

All issues in cloudflare/cfssl

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.