httpconnection: properly inject ssl_wrap_socket into httpclient (issue4038)
authorAugie Fackler <raf@durin42.com>
Fri, 20 Sep 2013 09:16:07 -0400
changeset 19809 50d721553198
parent 19808 3b82d412e9e8
child 19810 c80feeb715d1
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.
mercurial/httpconnection.py
--- a/mercurial/httpconnection.py	Fri Sep 20 09:15:43 2013 -0400
+++ b/mercurial/httpconnection.py	Fri Sep 20 09:16:07 2013 -0400
@@ -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