Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGc8ecd96cc357: py3: handle keyword arguments correctly in sslutil.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
self._ciphers = ciphers | self._ciphers = ciphers | ||||
def wrap_socket(self, socket, server_hostname=None, server_side=False): | def wrap_socket(self, socket, server_hostname=None, server_side=False): | ||||
# server_hostname is unique to SSLContext.wrap_socket and is used | # server_hostname is unique to SSLContext.wrap_socket and is used | ||||
# for SNI in that context. So there's nothing for us to do with it | # for SNI in that context. So there's nothing for us to do with it | ||||
# in this legacy code since we don't support SNI. | # in this legacy code since we don't support SNI. | ||||
args = { | args = { | ||||
'keyfile': self._keyfile, | r'keyfile': self._keyfile, | ||||
'certfile': self._certfile, | r'certfile': self._certfile, | ||||
'server_side': server_side, | r'server_side': server_side, | ||||
'cert_reqs': self.verify_mode, | r'cert_reqs': self.verify_mode, | ||||
'ssl_version': self.protocol, | r'ssl_version': self.protocol, | ||||
'ca_certs': self._cacerts, | r'ca_certs': self._cacerts, | ||||
'ciphers': self._ciphers, | r'ciphers': self._ciphers, | ||||
} | } | ||||
return ssl.wrap_socket(socket, **args) | return ssl.wrap_socket(socket, **args) | ||||
def _hostsettings(ui, hostname): | def _hostsettings(ui, hostname): | ||||
"""Obtain security settings for a hostname. | """Obtain security settings for a hostname. | ||||
Returns a dict of settings relevant to that hostname. | Returns a dict of settings relevant to that hostname. |