Browse Source

Complete change for removal of serverCNPrefixes (r7973).

git-svn-id: http://proj.badc.rl.ac.uk/svn/ndg-security/trunk/ndg_httpsclient@8002 051b1e3e-aa0c-0410-b6c2-bfbade6052be
rwilkinson 13 years ago
parent
commit
ec571bef7a
2 changed files with 3 additions and 5 deletions
  1. 2 4
      ndg/httpsclient/ssl_peer_verification.py
  2. 1 1
      setup.py

+ 2 - 4
ndg/httpsclient/ssl_peer_verification.py

@@ -98,14 +98,12 @@ class ServerSSLCertVerification(object):
                               'certificate against')
                     return False
 
-                acceptableCNs = [pfx + self.hostname
-                                 for pfx in self.serverCNPrefixes]
-                if peerCertSubj.commonName in acceptableCNs:
+                if peerCertSubj.commonName == self.hostname:
                     return preverifyOK
                 else:
                     log.error('Peer certificate CN %r doesn\'t match the '
                               'expected CN %r', peerCertSubj.commonName,
-                              acceptableCNs)
+                              self.hostname)
                     return False
             else:
                 if peerCertDN == self.certDN:

+ 1 - 1
setup.py

@@ -44,7 +44,7 @@ Options::
     
 setup(
     name='ndg_httpsclient',
-    version="0.1.0",
+    version="0.1.1",
     description='Provides enhanced HTTPS support for httplib and urllib2 using '
                 'PyOpenSSL',
     author='Richard Wilkinson and Philip Kershaw',