-
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
FastHttpLocust gives ssl error with let's encrypt certs #1137
Comments
I got the same error today (unsure about what kind of cert the site is using). Using geventhttpclient directly works, so does not seem to be an issue with geventhttpclient itself. e.g. this works:
|
@cyberw I don't think your example will use SSL/TLS since you use This example should fail: from geventhttpclient import HTTPClient
from geventhttpclient.url import URL
url = URL("https://mydomain")
http = HTTPClient.from_url(url)
response = http.post(url.request_uri) |
@heyman yes, you are right. |
Gah. I'm completely stuck on this. Any ideas @skivis ? I'm fine with disabling the checks, but I cant figure out how to do that either. |
I finally figured out how to disable the check (without editing my pip-installed geventhttpclient in place :) I added this to my locustfile:
|
I think changing this line: locust/locust/contrib/fasthttp.py Line 91 in cfad799
to: self.client = LocustUserAgent(max_retries=1, cookiejar=self.cookiejar, insecure=True, **kwargs) should disable SSL verification, which I think should be okay for us to do in a client which is supposed to be as fast as possible (in a load testing tool). |
Should be fixed by 66d68da |
I could have sworn I tried that (or at least something similar), but it didnt work for me. looks good now though! |
... on second thought, it doesnt work for self signed certificates. I still get [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076) But my workaround does work. |
Ah, good catch! I've incorporated your fix in 274677f I made a small locustfile for testing all sorts of different SSL/TLS scenarios using the neat https://badssl.com/ website. Posting it here for future reference: from locust import HttpLocust, TaskSet, task, constant
from locust.contrib.fasthttp import FastHttpLocust
from pyquery import PyQuery
class UserTasks(TaskSet):
def get(self, url):
return self.client.get(url, name=url)
@task
def test_bad_ssl(self):
response = self.get("https://badssl.com")
pq = PyQuery(response.text)
for link in pq("#links a:not(.external)"):
url = link.attrib["href"]
if not url.startswith("https://"):
continue
self.get(url)
class SSLTestUser(FastHttpLocust):
host = "https://badssl.com"
wait_time = constant(1)
task_set = UserTasks It depends in PyQuery. Run it with:
Currently it only fails for the client certificate pages, which makes sense, and the subdomain.preloaded-hsts which also doesn't seem strange since geventhttpclient doesn't support HSTS. |
Great! badssl.com is a neat concept! |
thanks for fixing this, even if the fix is kinda weird :) |
domains which have regular cert work okay. also the normal http client works okay.
os: alpine linux (with
apk add ca-certificates
)python: 3.7
locust master branch
The text was updated successfully, but these errors were encountered: