pyca / pyca/pyopenssl

Documentation is misleading about when get_notBefore and get_notAfter return None

Open Beginner friendly
#1,488 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
944
Forks
440
Avg merge
1d 6h
Merged PRs (30d)
6

Description

The docs for get_notBefore and get_notAfter say:

A timestamp string, or None if there is none.
https://pyopenssl.org/en/stable/api/crypto.html#OpenSSL.crypto.X509.get_notAfter

But there is no such thing as a certificate without a notBefore or notAfter. They're not optional fields. What can happen is that the string is invalid, if the underlying OpenSSL's parser defers rejecting bad time values. So perhaps it should say "or None if the timestamp could not be parsed" or something like that.

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 linked API documentation for X509.get_notBefore and X509.get_notAfter, then locate the source documentation for those methods. Update the description of None to explain that it indicates an unparseable timestamp, and verify that both rendered API entries use the corrected wording.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.