/[packages]/cauldron/python-httplib2/current/SOURCES/httplib2-use-system-certs.patch
ViewVC logotype

Annotation of /cauldron/python-httplib2/current/SOURCES/httplib2-use-system-certs.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 425497 - (hide annotations) (download)
Thu May 23 21:24:08 2013 UTC (11 years, 1 month ago) by philippem
File size: 2614 byte(s)
fix P3K cert file not found
1 philippem 268282 diff -up ./python2/httplib2/__init__.py.orig ./python2/httplib2/__init__.py
2 philippem 296887 --- ./python2/httplib2/__init__.py.orig 2012-09-11 19:22:30.000000000 +0200
3     +++ ./python2/httplib2/__init__.py 2012-09-23 12:20:19.242106911 +0200
4     @@ -183,8 +183,9 @@ class CertificateHostnameMismatch(SSLHan
5 philippem 268282 DEFAULT_MAX_REDIRECTS = 5
6    
7     # Default CA certificates file bundled with httplib2.
8     -CA_CERTS = os.path.join(
9     - os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
10     +#CA_CERTS = os.path.join(
11     +# os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
12     +CA_CERTS = "/etc/ssl/certs/ca-bundle.crt"
13    
14     # Which headers are hop-by-hop headers by default
15     HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']
16 philippem 296887 @@ -957,11 +958,12 @@ class HTTPSConnectionWithTimeout(httplib
17 philippem 268282 list: A list of valid host globs.
18     """
19     if 'subjectAltName' in cert:
20     - return [x[1] for x in cert['subjectAltName']
21     - if x[0].lower() == 'dns']
22     - else:
23     - return [x[0][1] for x in cert['subject']
24     - if x[0][0].lower() == 'commonname']
25     + # Patch from richardfearn@gmail.com
26     + return [x[1] for x in cert['subjectAltName']
27     + if x[0].lower() == "dns"]
28     +
29     + return [x[0][1] for x in cert['subject']
30     + if x[0][0].lower() == 'commonname']
31    
32     def _ValidateCertificateHostname(self, cert, hostname):
33     """Validates that a given hostname is valid for an SSL certificate.
34 philippem 425497 diff -up ./python3/httplib2/__init__.py ./python3/httplib2/__init__.py
35     --- ./python3/httplib2/__init__.py 2013-03-06 21:45:31.000000000 +0100
36     +++ ./python3/httplib2/__init__.py 2013-03-22 14:01:51.270409717 +0100
37     @@ -124,8 +124,8 @@
38     HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']
39    
40     # Default CA certificates file bundled with httplib2.
41     -CA_CERTS = os.path.join(
42     - os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
43     +CA_CERTS = "/etc/ssl/certs/ca-bundle.crt"
44     +
45    
46     def _get_end2end_headers(response):
47     hopbyhop = list(HOP_BY_HOP)
48 philippem 296887 --- ./setup.py.orig 2012-09-11 19:22:30.000000000 +0200
49     +++ ./setup.py 2012-09-23 12:23:34.737350441 +0200
50     @@ -62,7 +62,6 @@ A comprehensive HTTP client library, ``h
51 philippem 268282 """,
52     package_dir=pkgdir,
53     packages=['httplib2'],
54     - package_data={'httplib2': ['*.txt']},
55     classifiers=[
56     'Development Status :: 4 - Beta',
57     'Environment :: Web Environment',
58    

  ViewVC Help
Powered by ViewVC 1.1.30