Patchwork [3,of,3,ssl-followups] sslutil: drop defunct ssl version constants

login
register
mail settings
Submitter Augie Fackler
Date Jan. 14, 2015, 8:53 p.m.
Message ID <ae22305431c15e568d22.1421268807@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/7452/
State Accepted
Commit 948a8ca27152f9b5928d118951052e8541a84486
Headers show

Comments

Augie Fackler - Jan. 14, 2015, 8:53 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1421268381 18000
#      Wed Jan 14 15:46:21 2015 -0500
# Node ID ae22305431c15e568d22eb03941d5269c5944226
# Parent  dc0d263e6931670d64e4df89bacd53fdaca2fed1
sslutil: drop defunct ssl version constants

Nobody outside sslutil should be using these constants anyway.
Matt Mackall - Jan. 14, 2015, 11:35 p.m.
On Wed, 2015-01-14 at 15:53 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1421268381 18000
> #      Wed Jan 14 15:46:21 2015 -0500
> # Node ID ae22305431c15e568d22eb03941d5269c5944226
> # Parent  dc0d263e6931670d64e4df89bacd53fdaca2fed1
> sslutil: drop defunct ssl version constants

These are queued for default, thanks.

Patch

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -14,7 +14,6 @@  try:
     # avoid using deprecated/broken FakeSocket in python 2.6
     import ssl
     CERT_REQUIRED = ssl.CERT_REQUIRED
-    PROTOCOL_TLSv1 = ssl.PROTOCOL_TLSv1
     try:
         ssl_context = ssl.SSLContext
 
@@ -50,7 +49,7 @@  try:
                             ca_certs=None, serverhostname=None):
             sslsocket = ssl.wrap_socket(sock, keyfile, certfile,
                                         cert_reqs=cert_reqs, ca_certs=ca_certs,
-                                        ssl_version=PROTOCOL_TLSv1)
+                                        ssl_version=ssl.PROTOCOL_TLSv1)
             # check if wrap_socket failed silently because socket had been
             # closed
             # - see http://bugs.python.org/issue13721
@@ -60,8 +59,6 @@  try:
 except ImportError:
     CERT_REQUIRED = 2
 
-    PROTOCOL_TLSv1 = 3
-
     import socket, httplib
 
     def ssl_wrap_socket(sock, keyfile, certfile, cert_reqs=CERT_REQUIRED,