Merge lp:~james-w/lazr.restfulclient/use-system-ca-certs into lp:lazr.restfulclient

Proposed by James Westby on 2012-12-06
Status: Merged
Approved by: j.c.sackett on 2012-12-06
Approved revision: 134
Merged at revision: 134
Proposed branch: lp:~james-w/lazr.restfulclient/use-system-ca-certs
Merge into: lp:lazr.restfulclient
Diff against target: 48 lines (+19/-1)
2 files modified
src/lazr/restfulclient/NEWS.txt (+14/-0)
src/lazr/restfulclient/_browser.py (+5/-1)
To merge this branch: bzr merge lp:~james-w/lazr.restfulclient/use-system-ca-certs
Reviewer Review Type Date Requested Status
j.c.sackett (community) 2012-12-06 Approve on 2012-12-06
Review via email: mp+138520@code.launchpad.net

Commit Message

Override the ca certs path for httplib2 to Ubuntu's system certs.

Description of the Change

Hi,

This should allow launchpadlib to be used on Ubuntu when the Ubuntu patched httplib2
isn't in use. I need this for oops.canonical.com as it is using httplib2 from
buildout.

The NEWS file should explain the rationale.

Thanks,

James

To post a comment you must log in.
j.c.sackett (jcsackett) wrote :

Looks good, James.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lazr/restfulclient/NEWS.txt'
2--- src/lazr/restfulclient/NEWS.txt 2012-09-26 07:36:18 +0000
3+++ src/lazr/restfulclient/NEWS.txt 2012-12-06 17:26:20 +0000
4@@ -2,6 +2,20 @@
5 NEWS for lazr.restfulclient
6 ===========================
7
8+0.13.2 (2012-12-06)
9+===================
10+
11+ - lazr.restfulclient is almost exclusively used with launchpad.net,
12+ but httplib2's cert bundle doesn't include launchpad's CA. Therefore
13+ with the default setup launchpadlib doesn't work unless cert checking
14+ is disabled. This is mitigated by the fact that Ubuntu carries a patch
15+ to httplib2 to make it use the system CA certs. This release makes that
16+ the default approach in lazr.restfulclient so that launchpad.net can be
17+ used by anyone with the Debian/Ubuntu CA certs path
18+ (/etc/ssl/certs/ca-certificates.crt), regardless of whether they are
19+ using Ubuntu's patched version of httplib2. Any platforms that don't have
20+ that path remain broken.
21+
22 0.13.1 (2012-09-26)
23 ===================
24
25
26=== modified file 'src/lazr/restfulclient/_browser.py'
27--- src/lazr/restfulclient/_browser.py 2012-06-19 11:43:54 +0000
28+++ src/lazr/restfulclient/_browser.py 2012-12-06 17:26:20 +0000
29@@ -110,6 +110,9 @@
30 os.environ.get('LP_DISABLE_SSL_CERTIFICATE_VALIDATION', False))
31
32
33+SYSTEM_CA_CERTS = '/etc/ssl/certs/ca-certificates.crt'
34+
35+
36 class RestfulHttp(Http):
37 """An Http subclass with some custom behavior.
38
39@@ -125,7 +128,8 @@
40 cert_disabled = ssl_certificate_validation_disabled()
41 super(RestfulHttp, self).__init__(
42 cache, timeout, proxy_info,
43- disable_ssl_certificate_validation=cert_disabled)
44+ disable_ssl_certificate_validation=cert_disabled,
45+ ca_certs=SYSTEM_CA_CERTS)
46 self.authorizer = authorizer
47 if self.authorizer is not None:
48 self.authorizer.authorizeSession(self)

Subscribers

People subscribed via source and target branches