Skip to content
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

Disable SSL: CERITIFICATE_VERIFY_FAILED #1104

Closed
Khrove opened this issue Oct 3, 2019 · 1 comment
Closed

Disable SSL: CERITIFICATE_VERIFY_FAILED #1104

Khrove opened this issue Oct 3, 2019 · 1 comment

Comments

@Khrove
Copy link

Khrove commented Oct 3, 2019

Description of issue

Hey all, new to Locust here. So I'm testing API's behind a firewall with HTTP requests. I want to ignore the SSL warning. I see in some other Github issues here the fix is to add verify=False to your requests. I've tried this but my error is still occurring:

SSLError(MaxRetryError("HTTPSConnectionPool(host='partner.int.xxxxx.com', port=4443): Max retries exceeded with url: /api/router (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1076)')))"))

my code is:

`
from locust import HttpLocust, TaskSet, task

class UserBehavior(TaskSet):

def on_start(self):
    """ on_start is called when a Locust start before any task is scheduled """
    self.client.verify = False
    self.login_page()

@task(1)
def router_page(self):
    self.client.post("/api/router", "verify=False", {"AgencyCode":"xxxx", "selectedRedirectType":"1"})

@task(2)
def login_page(self):
    self.client.post("/api/login", "verify=False", {"Password":"xxxxx","ReturnUrl":"","UserName":"xxxx@gmail.com"})

class WebsiteUser(HttpLocust):
task_set = UserBehavior
host = "xxxxx"
min_wait = 5000
max_wait = 9000
`

@cgoldberg
Copy link
Member

cgoldberg commented Oct 3, 2019

it is a keyword arg, not a string. (verify=False not "verify=False")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants