Blame SOURCES/python-httplib2.rfc2459.patch

6a3e49
diff -up ./python2/httplib2/__init__.py.orig ./python2/httplib2/__init__.py
6a3e49
--- ./python2/httplib2/__init__.py.orig	2012-07-27 18:35:59.215300471 +1000
6a3e49
+++ ./python2/httplib2/__init__.py	2012-07-27 18:36:30.697287505 +1000
6a3e49
@@ -943,8 +943,13 @@ class HTTPSConnectionWithTimeout(httplib
6a3e49
         """
6a3e49
         if 'subjectAltName' in cert:
6a3e49
             # Patch from richardfearn@gmail.com
6a3e49
-	    return [x[1] for x in cert['subjectAltName']
6a3e49
+            # RFC 2459 states that subjectAltName may contain:
6a3e49
+            # either DNS, email, IP or URI
6a3e49
+            # email, URI,
6a3e49
+            hosts=[x[1] for x in cert['subjectAltName']
6a3e49
                 if x[0].lower() == "dns"]
6a3e49
+	    if hosts:
6a3e49
+		return hosts
6a3e49
6a3e49
         return [x[0][1] for x in cert['subject']
6a3e49
             if x[0][0].lower() == 'commonname']
6a3e49