Merge lp:~jml/launchpadlib/ssl-creds into lp:launchpadlib
| Status: | Merged |
|---|---|
| Merged at revision: | 128 |
| Proposed branch: | lp:~jml/launchpadlib/ssl-creds |
| Merge into: | lp:launchpadlib |
| Diff against target: |
61 lines (+31/-8) 1 file modified
src/launchpadlib/credentials.py (+31/-8) |
| To merge this branch: | bzr merge lp:~jml/launchpadlib/ssl-creds |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Benji York (community) | code | 2012-06-18 | Approve on 2012-06-18 |
|
Review via email:
|
|||
Description of the Change
Same thing as https:/
The SSL certificates for launchpad.dev and dogfood are invalid, but we still want to test against them. Add an environment variable to disable certificate checking.
<jml> oh right.
<jml> I can't seem to use the API against launchpad.dev
<jml> I get an error about SSL.
<wgrant> Yeah, cert verification will break that.
<jml> httplib2.
<jml> wgrant: is there a work around?
<wgrant> I either hack launchpadlib to not verify the cert, or generate a new cert for launchpad.dev and tell it to trust that.
<cjwatson> I often end up hacking httplib2.
<cjwatson> (search for disable_ssl and change False defaults to True)
<cjwatson> I wish there were an environment variable override.
<cjwatson> dogfood has the same problem.
<jml> wgrant, cjwatson: thanks.
<wgrant> jml: In lazr.restfulcli
<jml> wgrant: even better, thanks.
<cjwatson> There are three sites you need to change, IME.
<cjwatson> I always forget the full list.
<cjwatson> Which is why I've started editing httplib2 instead.
<wgrant> Yeah
<wgrant> Trial and error works for me...
<cjwatson> Because not all the call sites are in the same file.
<wgrant> Yep
| Jonathan Lange (jml) wrote : | # |
Good point re discoverability. I've annotated the exception.
| Benji York (benji) wrote : | # |
The extra info in the exception looks great.

Looks good.
It's too bad that the environment variable isn't discoverable. Maybe we could annotate SSH certificate errors with a message about how to disable validation. Or we could just whitelist the development sites with known-bad certs and the user won't see the errors to start with.