[PATCH 3 of 5 clonebundles V2] sslutil: expose attribute indicating whether SNI is supported

Gregory Szorc gregory.szorc at gmail.com
Fri Oct 9 14:33:52 CDT 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1443568652 25200
#      Tue Sep 29 16:17:32 2015 -0700
# Node ID 0a6acb63419fb7835c48ad4967ef8ed34e70aa94
# Parent  1f416cf58a7fb31d94ddee6671637ac51c03be9f
sslutil: expose attribute indicating whether SNI is supported

This will be used so clone bundles can advertise whether URLs require
SNI. This will be explained more in a subsequent patch.

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -15,8 +15,10 @@ import sys
 
 from .i18n import _
 from . import util
 
+hassni = getattr(ssl, 'HAS_SNI', False)
+
 _canloaddefaultcerts = False
 try:
     ssl_context = ssl.SSLContext
     _canloaddefaultcerts = util.safehasattr(ssl_context, 'load_default_certs')


More information about the Mercurial-devel mailing list