Patchwork [1,of,3] sslutil: rename 'minimumprotocolui' -> 'minimumprotocol'

login
register
mail settings
Submitter Manuel Jacob
Date June 1, 2020, 12:43 p.m.
Message ID <776bb7e68bba72e8f37d.1591015390@tmp>
Download mbox | patch
Permalink /patch/46446/
State Accepted
Headers show

Comments

Manuel Jacob - June 1, 2020, 12:43 p.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1591013226 -7200
#      Mon Jun 01 14:07:06 2020 +0200
# Node ID 776bb7e68bba72e8f37d81737df46e63e2565b2a
# Parent  d61c05450b378372437b8ea499ff43ce0b7f5cb3
# EXP-Topic sslutil-cleanup
sslutil: rename 'minimumprotocolui' -> 'minimumprotocol'

Before, both 'minimumprotocolui' and 'minimumprotocol' were used, but meaning
the same.
Yuya Nishihara - June 1, 2020, 2:02 p.m.
On Mon, 01 Jun 2020 14:43:10 +0200, Manuel Jacob wrote:
> # HG changeset patch
> # User Manuel Jacob <me@manueljacob.de>
> # Date 1591013226 -7200
> #      Mon Jun 01 14:07:06 2020 +0200
> # Node ID 776bb7e68bba72e8f37d81737df46e63e2565b2a
> # Parent  d61c05450b378372437b8ea499ff43ce0b7f5cb3
> # EXP-Topic sslutil-cleanup
> sslutil: rename 'minimumprotocolui' -> 'minimumprotocol'

Queued for default, thanks.

Patch

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -81,7 +81,7 @@  def _hostsettings(ui, hostname):
         b'protocol': None,
         # String representation of minimum protocol to be used for UI
         # presentation.
-        b'minimumprotocolui': None,
+        b'minimumprotocol': None,
         # ssl.CERT_* constant used by SSLContext.verify_mode.
         b'verifymode': None,
         # Defines extra ssl.OP* bitwise options to set.
@@ -123,7 +123,7 @@  def _hostsettings(ui, hostname):
     if ui.insecureconnections:
         minimumprotocol = b'tls1.0'
 
-    s[b'minimumprotocolui'] = minimumprotocol
+    s[b'minimumprotocol'] = minimumprotocol
     s[b'protocol'], s[b'ctxoptions'] = protocolsettings(minimumprotocol)
 
     ciphers = ui.config(b'hostsecurity', b'ciphers')
@@ -402,7 +402,7 @@  def wrapsocket(sock, keyfile, certfile, 
             # reason, try to emit an actionable warning.
             if e.reason == 'UNSUPPORTED_PROTOCOL':
                 # We attempted TLS 1.0+.
-                if settings[b'minimumprotocolui'] == b'tls1.0':
+                if settings[b'minimumprotocol'] == b'tls1.0':
                     # We support more than just TLS 1.0+. If this happens,
                     # the likely scenario is either the client or the server
                     # is really old. (e.g. server doesn't support TLS 1.0+ or
@@ -447,7 +447,7 @@  def wrapsocket(sock, keyfile, certfile, 
                             b'to be more secure than the server can support)\n'
                         )
                         % (
-                            settings[b'minimumprotocolui'],
+                            settings[b'minimumprotocol'],
                             pycompat.bytesurl(serverhostname),
                         )
                     )