c9735f
diff -up ./python2/httplib2/__init__.py.getCertHost ./python2/httplib2/__init__.py
c9735f
--- ./python2/httplib2/__init__.py.getCertHost	2012-05-03 17:16:33.834155219 +1000
c9735f
+++ ./python2/httplib2/__init__.py	2012-06-21 18:19:33.804660257 +1000
c9735f
@@ -942,11 +942,12 @@ class HTTPSConnectionWithTimeout(httplib
c9735f
           list: A list of valid host globs.
c9735f
         """
c9735f
         if 'subjectAltName' in cert:
c9735f
-            return [x[1] for x in cert['subjectAltName']
c9735f
-                    if x[0].lower() == 'dns']
c9735f
-        else:
c9735f
-            return [x[0][1] for x in cert['subject']
c9735f
-                    if x[0][0].lower() == 'commonname']
c9735f
+            # Patch from richardfearn@gmail.com
c9735f
+	    return [x[1] for x in cert['subjectAltName']
c9735f
+                if x[0].lower() == "dns"]
c9735f
+
c9735f
+        return [x[0][1] for x in cert['subject']
c9735f
+            if x[0][0].lower() == 'commonname']
c9735f
 
c9735f
     def _ValidateCertificateHostname(self, cert, hostname):
c9735f
         """Validates that a given hostname is valid for an SSL certificate.