Blame SOURCES/python-httplib2.rfc2459.patch

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