Reputation: 73
I have a https server that requires credentials(Username , password) in order to access it
Im using python2.7:
r = requests.get('https://icarus:10113/pc/testReport/5')
and Im geting the below error
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
How can I set in my code something like
r = requests.get('https://icarus:10113/pc/testReport/5', myuser,mypassword)
to make it work?
Upvotes: 0
Views: 320
Reputation: 475
You can pass your credentials as data tuple:
r = requests.get('https://icarus:10113/pc/testReport/5', data={'username':'yourusername','password':'yourpassword'})
Upvotes: 0
Reputation: 166
Try to use auth=(user/pass tuple) as following:
res = requests.get(url, auth=(user, passwd), headers=header, data=data)
Upvotes: 2