Patchwork [4,of,4,force-tls] httpconnection: properly inject ssl_wrap_socket into httpclient (issue4038)

login
register
mail settings
Submitter Augie Fackler
Date Sept. 20, 2013, 2:30 p.m.
Message ID <4bc5d96a602e6a88faf2.1379687401@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/2563/
State Accepted
Commit 50d721553198cea51c30f53b76d41dc919280097
Headers show

Comments

Augie Fackler - Sept. 20, 2013, 2:30 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1379682967 14400
#      Fri Sep 20 09:16:07 2013 -0400
# Node ID 4bc5d96a602e6a88faf2a166033aaec48793722e
# Parent  eae807f37c737c10c49279574f29c045f3d16496
httpconnection: properly inject ssl_wrap_socket into httpclient (issue4038)

This causes httpclient to use the same SSL settings as the rest of
Mercurial, and adds an easy extension point for later modifications to
our ssl handling.
Matt Mackall - Sept. 24, 2013, 6:17 p.m.
On Fri, 2013-09-20 at 10:30 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <raf@durin42.com>
> # Date 1379682967 14400
> #      Fri Sep 20 09:16:07 2013 -0400
> # Node ID 4bc5d96a602e6a88faf2a166033aaec48793722e
> # Parent  eae807f37c737c10c49279574f29c045f3d16496
> httpconnection: properly inject ssl_wrap_socket into httpclient (issue4038)
> 
> This causes httpclient to use the same SSL settings as the rest of
> Mercurial, and adds an easy extension point for later modifications to
> our ssl handling.

These are queued for default, thanks.

Patch

diff --git a/mercurial/httpconnection.py b/mercurial/httpconnection.py
--- a/mercurial/httpconnection.py
+++ b/mercurial/httpconnection.py
@@ -275,14 +275,13 @@ 
             if '[' in host:
                 host = host[1:-1]
 
-        if keyfile:
-            kwargs['keyfile'] = keyfile
-        if certfile:
-            kwargs['certfile'] = certfile
+        kwargs['keyfile'] = keyfile
+        kwargs['certfile'] = certfile
 
         kwargs.update(sslutil.sslkwargs(self.ui, host))
 
         con = HTTPConnection(host, port, use_ssl=True,
+                             ssl_wrap_socket=sslutil.ssl_wrap_socket,
                              ssl_validator=sslutil.validator(self.ui, host),
                              **kwargs)
         return con