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

login
register
mail settings
Submitter Gregory Szorc
Date Oct. 9, 2015, 7:33 p.m.
Message ID <0a6acb63419fb7835c48.1444419232@gps-mbp.local>
Download mbox | patch
Permalink /patch/10933/
State Accepted
Delegated to: Matt Mackall
Headers show

Comments

Gregory Szorc - Oct. 9, 2015, 7:33 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

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')