Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Fix extracting dates from certificates using UTCTime #472

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

starstuck
Copy link

When connecting to ejabberd with .pam certificates, I was getting error that certificate is expired.

I have debugged the issue and it turned out, that notBefore and notAfter components of certificate are encoded as UTCTime in my certificate. That data format have only 2 digits of year, versus 4 digits in GeneralizedTime. That difference was causing datetime.strptime to wrongly interpret year.

My change is avoiding conversion to/from string in favour of using built in pyasn1 methods for conversion to datetime. That solution should work independent on time format used in cerificate.

@Neustradamus
Copy link

@tomstarstuck Can you look with "master"?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants