Search code examples
pythonapisni

How to add support for SNI in python 2.7


An api from some website supports SNI(Server Name Indication). But it also reminds me that SNI is only support after python 3.4. However, I currently use python 2.7 and have no intention to upgrade to python3.4 yet.

Is there any solution to use SNI with python 2.7? Detailed explaination and examples are highly appreciated.


Solution

  • Many network security features, including SNI support, were backported from Python 3.4 and released in Python 2.7.9. See https://docs.python.org/2/whatsnew/2.7.html#pep-466-network-security-enhancements-for-python-2-7