Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
In python you can use requests to connect to an endpoint an fetch result or create a new endpoint and so on. When you GET result from an endpoint which has an invalid https, the library will give an error. In order to solve this problem you can pass verify=False to requests.get().

A sample would be like:

payload = requests.get(url, auth=HTTPBasicAuth(username, password), verify=False)

Now another issue happens and a WARNING message appears in your log InsecureRequestWarning. You can surpass this message as well by the command below:

from requests.packages.urllib3.exceptions import InsecureRequestWarning

requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

NOTE: I have done this on a local server behind a firewall, be extremely cautious in case you want to do this on your production server.

#python #requests #InsecureRequestWarning #verify #urllib3