summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/cert.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-09-13 11:00:58 -0700
committerLance Stout <lancestout@gmail.com>2012-09-13 11:00:58 -0700
commit67147570e9be7f51fd079c98f1d6db35fe28563c (patch)
tree65d5ba86be1cbc7fc6cebca7a547b5efebceb028 /sleekxmpp/xmlstream/cert.py
parentdf9ac58d051e195143875e03ce09a3994ade0e00 (diff)
parentfb3e6b7e35bb949f73a756ae5be683e2fec12454 (diff)
downloadslixmpp-67147570e9be7f51fd079c98f1d6db35fe28563c.tar.gz
slixmpp-67147570e9be7f51fd079c98f1d6db35fe28563c.tar.bz2
slixmpp-67147570e9be7f51fd079c98f1d6db35fe28563c.tar.xz
slixmpp-67147570e9be7f51fd079c98f1d6db35fe28563c.zip
Merge branch 'master' into develop
Diffstat (limited to 'sleekxmpp/xmlstream/cert.py')
-rw-r--r--sleekxmpp/xmlstream/cert.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sleekxmpp/xmlstream/cert.py b/sleekxmpp/xmlstream/cert.py
index 339f872d..6e877efc 100644
--- a/sleekxmpp/xmlstream/cert.py
+++ b/sleekxmpp/xmlstream/cert.py
@@ -147,7 +147,10 @@ def verify(expected, raw_cert):
raise CertificateError(
'Certificate has expired.')
- expected_wild = expected[expected.index('.'):]
+ if '.' in expected:
+ expected_wild = expected[expected.index('.'):]
+ else:
+ expected_wild = expected
expected_srv = '_xmpp-client.%s' % expected
for name in cert_names['XMPPAddr']:
@@ -160,7 +163,10 @@ def verify(expected, raw_cert):
if name == expected:
return True
if name.startswith('*'):
- name_wild = name[name.index('.'):]
+ if '.' in name:
+ name_wild = name[name.index('.'):]
+ else:
+ name_wild = name
if expected_wild == name_wild:
return True
for name in cert_names['URI']: