-1

I am trying write a python equivalent script for the cURLcommand below using Requests library. I am not able to find relevant flags to disable SSL verification and set no proxy.

curl -v -k -T debug.zip https://url-to-no-ssl-server/index.aspx --noproxy url-to-no-ssl-server -X POST -H "filename: debug.zip"

How do I convert this command to python-requests?

jaykumarark
  • 2,359
  • 6
  • 35
  • 53

1 Answers1

0

This SO Answer shows how to disable proxies:

session = requests.Session()
session.trust_env = False

The documentation for requests has disabling SSL verification:

Requests can also ignore verifying the SSL certificate if you set verify to False:

requests.get('https://kennethreitz.com', verify=False)
<Response [200]>

By default, verify is set to True. Option verify only applies to host certs.

Community
  • 1
  • 1
TemporalWolf
  • 7,727
  • 1
  • 30
  • 50