SleekXMPP icon indicating copy to clipboard operation
SleekXMPP copied to clipboard

Fix extracting dates from certificates using UTCTime

Open starstuck opened this issue 7 years ago • 1 comments

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.

starstuck avatar Oct 10 '17 15:10 starstuck

@tomstarstuck Can you look with "master"?

Neustradamus avatar Apr 08 '19 01:04 Neustradamus