Reputation: 535
even though i keep verify= false, i'm getting ssl error in python. Could you tell me how do I avoid it? But curl command is working with -k option.
import json
import requests
url = "https://<url>/context"
payload = {"some":"data"}
headers = {"Authorization": "Basic:xxxxxxxxxx"}
response = requests.post(url, verify=False,
data=json.dumps(payload), headers=headers)
print(response)
error:
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning)
Upvotes: 3
Views: 6405
Reputation: 5942
It is just a warning. You can disable these warnings.
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
Upvotes: 1