Skip to content

Documentation is misleading about when get_notBefore and get_notAfter return None #1488

Description

@davidben

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions