Skip to content

Commit

Permalink
Allows self signed SSL certificates in FastHttpLocust
Browse files Browse the repository at this point in the history
  • Loading branch information
heyman committed Nov 14, 2019
1 parent 2f67b24 commit 274677f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion locust/contrib/fasthttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ConnectionRefusedError(Exception):
from http.cookiejar import CookieJar
unicode = str

import gevent
from gevent.timeout import Timeout
from geventhttpclient.useragent import UserAgent, CompatRequest, CompatResponse, ConnectionError
from geventhttpclient.response import HTTPConnectionClosed
Expand Down Expand Up @@ -88,7 +89,13 @@ class FastHttpSession(object):
def __init__(self, base_url, **kwargs):
self.base_url = base_url
self.cookiejar = CookieJar()
self.client = LocustUserAgent(max_retries=1, cookiejar=self.cookiejar, insecure=True, **kwargs)
self.client = LocustUserAgent(
max_retries=1,
cookiejar=self.cookiejar,
insecure=True,
ssl_options={"cert_reqs": gevent.ssl.CERT_NONE},
**kwargs
)

# Check for basic authentication
parsed_url = urlparse(self.base_url)
Expand Down

0 comments on commit 274677f

Please sign in to comment.