Mercurial > hg
comparison mercurial/httpconnection.py @ 19809:50d721553198
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.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 20 Sep 2013 09:16:07 -0400 |
parents | 98347af64593 |
children | 18a032704f0a |
comparison
equal
deleted
inserted
replaced
19808:3b82d412e9e8 | 19809:50d721553198 |
---|---|
273 host, port = host.rsplit(':', 1) | 273 host, port = host.rsplit(':', 1) |
274 port = int(port) | 274 port = int(port) |
275 if '[' in host: | 275 if '[' in host: |
276 host = host[1:-1] | 276 host = host[1:-1] |
277 | 277 |
278 if keyfile: | 278 kwargs['keyfile'] = keyfile |
279 kwargs['keyfile'] = keyfile | 279 kwargs['certfile'] = certfile |
280 if certfile: | |
281 kwargs['certfile'] = certfile | |
282 | 280 |
283 kwargs.update(sslutil.sslkwargs(self.ui, host)) | 281 kwargs.update(sslutil.sslkwargs(self.ui, host)) |
284 | 282 |
285 con = HTTPConnection(host, port, use_ssl=True, | 283 con = HTTPConnection(host, port, use_ssl=True, |
284 ssl_wrap_socket=sslutil.ssl_wrap_socket, | |
286 ssl_validator=sslutil.validator(self.ui, host), | 285 ssl_validator=sslutil.validator(self.ui, host), |
287 **kwargs) | 286 **kwargs) |
288 return con | 287 return con |