Merge lp:~bzr/bzr/urllib-verifies-ssl-certs into lp:bzr/2.5
| Status: | Merged |
|---|---|
| Approved by: | Vincent Ladeuil on 2012-01-20 |
| Approved revision: | 6265 |
| Merged at revision: | 6455 |
| Proposed branch: | lp:~bzr/bzr/urllib-verifies-ssl-certs |
| Merge into: | lp:bzr/2.5 |
| Prerequisite: | lp:~jelmer/bzr/urllib-verifies-ssl-certs |
| Diff against target: |
476 lines (+112/-79) 9 files modified
bzrlib/plugins/launchpad/lp_registration.py (+1/-5) bzrlib/plugins/launchpad/test_lp_directory.py (+9/-4) bzrlib/tests/https_server.py (+7/-1) bzrlib/tests/test_http.py (+21/-15) bzrlib/tests/test_https_urllib.py (+28/-28) bzrlib/transport/__init__.py (+3/-3) bzrlib/transport/http/_urllib.py (+15/-4) bzrlib/transport/http/_urllib2_wrappers.py (+24/-13) doc/en/release-notes/bzr-2.5.txt (+4/-6) |
| To merge this branch: | bzr merge lp:~bzr/bzr/urllib-verifies-ssl-certs |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jelmer Vernooij (community) | 2012-01-20 | Approve on 2012-01-20 | |
|
Review via email:
|
|||
Commit Message
Verify ssl certs for the http urllib implementation.
Description of the Change
THis builds on top of lp:~jelmer/bzr/urllib-verifies-ssl-certs to fix the
tests failures.
There were two kinds of hangs:
- from the client because the ssl errors weren't properly interpreted as
*not* transient (and were retried against a server which had no idea what
the client would want ;)
- from the server (a bit surprising since such hangs shouldn't occur anymore
?) because if the ssl handshake fails the request shouldn't be processed
(but the exception needed to be caught to recognize this).
In the future, we probably want to make ssl.ca_certs and ssl.cert_reqs
authentication config options so that proxies can use different options but
that in itself is also quite invasive and out of scope here. These are my
excuses for the semi-hackish way the ca_certs are propagated from the
transport to the _urllib2_wrappers classes. In the end, the plan is to make
them part of auth and proxy_auth credentials which will be a bit less
invasive and open to other options (self signed certificates for example).
Despite its docstring, match_hostname accept our test server 127.0.0.1 IP
address without a wink, I didn't investigate whether it's by luck or by
design. Any ideas ?
Anyway, this seems the fastest way to get certificate verification landed
for 2.5.
| Vincent Ladeuil (vila) wrote : | # |
sent to pqm by email

line 69:
+ # FIXME: We proabaly want more tests to capture which ssl
probably?
I also think this is fine for 2.5, so let's JFLI.