-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FastHttpUser doesn't use the SNI TLS extension #1360
Comments
Does it work if you set |
No it does not, same error with this code (and verified with packet capture)
|
geventhttpclient is supposed to have SNI support (geventhttpclient/geventhttpclient#109) but I can confirm that I can reproduce this bug. Would definitely be interested in a fix. |
Even though SNI support is supposed to work in geventhttpclient, it appears to be broken. This code causes the same exception: from geventhttpclient.useragent import UserAgent
ua = UserAgent()
response = ua.urlopen('https://locust.io')
print("response:", response) |
Found the same issue today, resolved this locally by changing the ssl_options to ssl_context_factory (the combination doesn't seem to be allowed) in 'locust/contrib/fasthttp.py'
Only this way, it seem to trigger to set the server_hostname, see
from https://github.com/gwik/geventhttpclient/blob/master/src/geventhttpclient/client.py#L97 The ssl_options was added because of let's encrypt certificates, I'm not sure if this is broken again. Hope this helps, I'm not sure what the right fix is (started with locust today)...... |
@tljdebrouwer Thanks for debugging! I've pushed a fix (0f6f217) which I believe solves it. |
Thanks. Fix looking good!
… Op 4 mei 2020 om 22:02 heeft Jonatan Heyman ***@***.***> het volgende geschreven:
@tljdebrouwer Thanks for debugging! I've pushed a fix which I believe solves it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Describe the bug
Some web server/reverse proxy require the client to announce which hostname it wants to connect to. It's done via the Server Name Indication TLS extension. This allow sharing the same public IP between multiple hostnames. locust.io for example uses Cloudflare, which requires SNI in this setup.
Unlike
HttpUser
,FastHttpUser
doesn't send the SNI extension, making all TLS connection to SNI-requiring servers fail.Users are warned that
FastHttpUser
doesn't necessarily implement the same feature set asHttpUser
, butgeventhttpclient
, used byFastHttpUser
does support SNI in the included version.Expected behavior
The FastHttpUser client send the SNI extension as
host
, and the TLS connection succeed.Actual behavior
The following error is obtained and every TLS connection
SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1108)')
It can confirmed by capturing the TLS Client Hello network packet.
Steps to reproduce
locustfile.py
:Execute
% locust -H 'https://locust.io' --headless
Environment
locust -H 'https://locust.io' --headless
The text was updated successfully, but these errors were encountered: