# HG changeset patch # User Matt Harbison # Date 1731346324 18000 # Node ID baeb5e8d2612f4d9871bfe3c3236af9700071c54 # Parent f1b37ed41f011d37df61d296947fe675c6e39db3 sslutil: drop the unused `commonssloptions()` The last usage was removed in 94cf83d9a2c9. diff -r f1b37ed41f01 -r baeb5e8d2612 mercurial/sslutil.py --- a/mercurial/sslutil.py Wed Nov 20 16:31:40 2024 -0500 +++ b/mercurial/sslutil.py Mon Nov 11 12:32:04 2024 -0500 @@ -234,31 +234,6 @@ return s -def commonssloptions(minimumprotocol): - """Return SSLContext options common to servers and clients.""" - if minimumprotocol not in configprotocols: - raise ValueError(b'protocol value not supported: %s' % minimumprotocol) - - # SSLv2 and SSLv3 are broken. We ban them outright. - options = ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 - - if minimumprotocol == b'tls1.0': - # Defaults above are to use TLS 1.0+ - pass - elif minimumprotocol == b'tls1.1': - options |= ssl.OP_NO_TLSv1 - elif minimumprotocol == b'tls1.2': - options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 - else: - raise error.Abort(_(b'this should not happen')) - - # Prevent CRIME. - # There is no guarantee this attribute is defined on the module. - options |= getattr(ssl, 'OP_NO_COMPRESSION', 0) - - return options - - def wrapsocket(sock, keyfile, certfile, ui, serverhostname=None): """Add SSL/TLS to a socket.