SNI support in python 2.7 for Locust load tests

Christian Heimes christian at
Tue Sep 30 19:39:16 CEST 2014

On 30.09.2014 16:50, Reddy wrote:
> Hello,
> At the beginning - welcome everyone, as this is my first post here. I'm not an active Python developer now, but I have general knowledge of the language. 
> I'm trying to use locust ( to run load test of one site we're developing. Everything was running nice and smooth until we switch the servers to use SNI. SNI is not officially supported in python 2.7.5 but Locust doesn't work on python3 as it uses gevent which AFAIK are supported for python2 only. I finally managed to run our scripts on local Ubuntu after upgrading python to 2.7.8 from utopic repository but I can't replicate the same on target CentOS where the scripts are supposed to be executed. I tried compiling python from, I even tried unpacking sources of Ubuntu python2.7 package (from, patching them with TLS1_1 and TLS1_2 s
>  upport from and still no luck. I do monkey patch in Locust startup file according to (oth
>  erwise it wouldn't work on Ubuntu as well) but still I get error stack as attached below. I also checked with pip list that all python packages have the same versions on both systems. Any idea what I'm missing on the target load test system which I have in Ubuntu? 


you have two options:

Python 2.7.9 implements PEP 466 "Network Security Enhancements for
Python 2.7.x" including TLS 1.1, 1.2 and SNI support. 2.7.9 will be
released shortly. You could try the 2.7 branch from

Use PyOpenSSL instead of Python's ssl module. It supports SNI, too.


More information about the Python-list mailing list