changeset 52287:baeb5e8d2612

sslutil: drop the unused `commonssloptions()` The last usage was removed in 94cf83d9a2c9.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 11 Nov 2024 12:32:04 -0500
parents f1b37ed41f01
children 7f8d0c2c3692
files mercurial/sslutil.py
diffstat 1 files changed, 0 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- 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.