SleekXMPP
SleekXMPP copied to clipboard
Fix extracting dates from certificates using UTCTime
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.
@tomstarstuck Can you look with "master"?