# HG changeset patch # User Gregory Szorc # Date 1463338249 25200 # Node ID 9b07017ba52818cee2d8cdfd852dbacbd353bda8 # Parent dffe78d80a6c5780f1ed9b153216fe4be21353b0 sslutil: remove redundant check of sslsocket.cipher() We are doing this check in both wrapsocket() and validatesocket(). The check was added to the validator in 4bb59919c905 and the commit message justifies the redundancy with a "might." The check in wrapsocket() was added in 0cc4ad757c77, which appears to be part of the same series. I'm going to argue the redundancy isn't needed. I choose to keep the check in wrapsocket() because it is working around a bug in Python's wrap_socket() and I feel the check for the bug should live next to the function call exhibiting the bug. diff -r dffe78d80a6c -r 9b07017ba528 mercurial/sslutil.py --- a/mercurial/sslutil.py Sun May 15 11:38:38 2016 -0700 +++ b/mercurial/sslutil.py Sun May 15 11:50:49 2016 -0700 @@ -299,8 +299,6 @@ host = sock._hgstate['hostname'] ui = sock._hgstate['ui'] - if not sock.cipher(): # work around http://bugs.python.org/issue13721 - raise error.Abort(_('%s ssl connection error') % host) try: peercert = sock.getpeercert(True) peercert2 = sock.getpeercert()