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

SSL Error when using Http Request #751

Closed
bharatk89 opened this issue Mar 16, 2018 · 3 comments
Closed

SSL Error when using Http Request #751

bharatk89 opened this issue Mar 16, 2018 · 3 comments

Comments

@bharatk89
Copy link

Description of issue / feature request

Getting SSLCertVerificationError when using Https request

Expected behavior

Should able to run test

Actual behavior

getting SSL error when performing test against internal API

Environment settings (for bug reports)

  • OS: Windows 10
  • Python version: Python 3.7
  • Locust version: Locust 0.8.1

Steps to reproduce (for bug reports)

I'm new to Locust and I'm running load testing against internal Rest API. The API uses header token for authorization. But when I pass the header information, it is throwing an error

I'm running the test using the following command
locust -f name.py

SSLError(SSLCertVerificationError

TBD - example code appreciated

  from locust import HttpLocust, TaskSet, task

  class SampleTest(TaskSet):

def on_start(self):
	self.client.post('rest api root url end point',
					headers={'Content-Type': 'application/json', 
					'Authorization': 'bearer  token'}
					)
						
	
@task(2)
def get_Listings(self):
	self.client.get("passing the end point of one service")
	
   class WebsiteUser(HttpLocust):
      host = "rest api root url endpoint"
      min_wait = 2000
      max_wait = 5000
      task_set = SampleTest       

image

@cgoldberg
Copy link
Member

http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification

** you can ignore cert verification by adding verify=False to your requests.

@uhbif19
Copy link

uhbif19 commented Nov 1, 2019

@cgoldberg This is not very convenient way, you need to patch each method.

@hamed-hatami
Copy link

hamed-hatami commented Sep 9, 2021

Hi guys,

@cgoldberg

Honestly, I gave the Locust a try via verify=False attribute in my post request but it still throws the https connection exception
What's the remedy ?

token_response = self.client.post('/auth/realms/xyz/protocol/openid-connect/token', verify=False, data=data_value, headers=header_value)

it doesn't work for me to call a https url from amazon

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

4 participants