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

Commit

Permalink
Remove two-digit-year variants from certificate validity date decodin…
Browse files Browse the repository at this point in the history
…g. Fixes Issue #461
  • Loading branch information
bear committed Sep 2, 2017
1 parent 285495d commit 65db8c3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions sleekxmpp/xmlstream/cert.py
Expand Up @@ -108,19 +108,11 @@ def extract_dates(raw_cert):

not_before = validity.getComponentByName('notBefore')
not_before = str(not_before.getComponent())
not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')

not_after = validity.getComponentByName('notAfter')
not_after = str(not_after.getComponent())

if isinstance(not_before, GeneralizedTime):
not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')
else:
not_before = datetime.strptime(not_before, '%y%m%d%H%M%SZ')

if isinstance(not_after, GeneralizedTime):
not_after = datetime.strptime(not_after, '%Y%m%d%H%M%SZ')
else:
not_after = datetime.strptime(not_after, '%y%m%d%H%M%SZ')
not_after = datetime.strptime(not_after, '%Y%m%d%H%M%SZ')

return not_before, not_after

Expand Down

3 comments on commit 65db8c3

@tebrown
Copy link

@tebrown tebrown commented on 65db8c3 Sep 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to break connecting to Google XMPP servers for GCM. I rolled back to 1.3.2 and everything worked ok

@bear
Copy link
Collaborator Author

@bear bear commented on 65db8c3 Sep 6, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdauvergne
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have two pull requests fixing this problem.

Please sign in to comment.