openssl / openssl/openssl

Enhance verify(1) to output the constructed chain certificates, not just the subject names as with `-short_chain`.

Open
#23,987 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

branch: master triaged: feature
Dominant language
C
Stars
30.8k
Forks
11.5k
Avg merge
10m
Merged PRs (30d)
1

Description

Presently, there is not a natural way to take a certificate and output its full trust path to an anchor in the trust store.

Also given a PEM file with certs, there isn't a natural way to output the text form of each certificate along with optoinally the PEM blobs.

Currently we have:

# Dump the text of multiple certs, far from obvious
$ openssl crl2pkcs7 -nocrl -certfile foo.pem | openssl pkcs7 -print_certs -text

# Construct a trust path:
$ openssl pkcs12 -export -chain -nokeys -passout pass:whatever \
       -in cert.pem -untrusted chain.pem |
       openssl pkcs12 -in /dev/stdin -passin pass:whatever

Ideally the 2nd use-cases should be possible with verify(1), while the first could be a "-multi" or similar option in x509(1).

### Tasks
- [ ] develop documentation for new option
- [ ] implement new option in verify command to output full cert chain in PEM format
- [ ] Add CI test to validate new option

Contributor guide

Open the contributing guide

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.

Research direction

Start with the verify(1) command and its existing -short_chain behavior, then review how x509(1) handles certificate output and how CI tests are organized. Define the new option's full-chain PEM output from the task description, add documentation and a CI test, and consider the separate x509(1) multi-certificate use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli, cryptography, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.