Saulo Abrantes
Saulo Abrantes

Reputation: 51

How to ignore an SSL: CERTIFICATE_VERIFY_FAILED error?

How do I keep my script running after encountering this error?

requests.exceptions.SSLError:
HTTPSConnectionPool(host='www.funcate.org.br', port=443): Max retries exceeded with url: /pt/portal-de-compras?file=../../../index.php%250A (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:718)'),))

Upvotes: 5

Views: 30131

Answers (1)

digitalarbeiter
digitalarbeiter

Reputation: 2335

You can switch off SSL certificate verification by passing verify=False as an extra argument to the requests.get() function:

response = requests.get('https://foobar.com.br/', verify=False)

Be advised that this will make you susceptible to all sorts of man in the middle attacks. SSL certificates are used for a reason :-) Although I realize that you are not necessarily in a position to enforce this.

Upvotes: 7

Related Questions