~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/ca_bundle.py

  • Committer: Vincent Ladeuil
  • Date: 2008-01-05 22:19:04 UTC
  • mto: (3928.1.1 bzr.integration)
  • mto: This revision was merged to the branch mainline in revision 3929.
  • Revision ID: v.ladeuil+lp@free.fr-20080105221904-185q2vl2hjbeul3d
Fix 1.1 related bugs in HTTP server, add HTTPS passing tests (by temporarily disabling pycurl certificate verification).

* doc/developers/authentication-ring.txt
(verify_certificates): Fix typo, obviously only apply to HTTPS 

* bzrlib/transport/http/ca_bundle.py:
(get_ca_path): Fix too long lines.

* bzrlib/transport/http/_pycurl.py:
(CURLE_SSL_CACERT): New error code.
(PyCurlTransport._set_curl_options): Temporarily disable peer
verification to make tests pass.
(PyCurlTransport._curl_perform): Catch CURLE_SSL_CACERT as a
connection error.
(get_test_permutations): Add HTTPS tests.

* bzrlib/tests/https_server.py:
(TestingHTTPSServer, TestingThreadingHTTPSServer): HTTPS test
servers.
(HTTPSServer_PyCurl): New class for pycurl HTTPS test server.

* bzrlib/tests/http_server.py:
(TestingHTTPRequestHandler.send_error): Overrides python version
since we need to specify a Content-Length.
(TestingHTTPRequestHandler.get_multiple_ranges): Sabotage !
Off-by-one error caused a buggy comment ! Went unnoticed until
pycurl+https hang.
(HttpServer.create_httpd): Allow server creation overriding.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    # from "Details on Server SSL Certificates"
37
37
    # http://curl.haxx.se/docs/sslcerts.html
38
38
    #
39
 
    # 4. If you're using the curl command line tool, you can specify your own CA
40
 
    #    cert path by setting the environment variable CURL_CA_BUNDLE to the path
41
 
    #    of your choice.
 
39
    # 4. If you're using the curl command line tool, you can specify your own
 
40
    #    CA cert path by setting the environment variable CURL_CA_BUNDLE to the
 
41
    #    path of your choice.
42
42
    #
43
 
    #    If you're using the curl command line tool on Windows, curl will search
44
 
    #    for a CA cert file named "curl-ca-bundle.crt" in these directories and in
45
 
    #    this order:
 
43
    #    If you're using the curl command line tool on Windows, curl will
 
44
    #    search for a CA cert file named "curl-ca-bundle.crt" in these
 
45
    #    directories and in this order:
46
46
    #      1. application's directory
47
47
    #      2. current working directory
48
48
    #      3. Windows System directory (e.g. C:\windows\system32)