⬅︎ Back to Best practice with retries with requests
Great solution! How can it be adapted so that if the request fails for a SSL certificate issue it retries but this time with verify=false. I've also asked on Stackoverflow but receive no reply: https://stackoverflow.com/questions/62258005/requests-retry-with-verify-false-if-sslerror Thanks for your help.
Something like this?```from requests.exceptions import SSLErrorsession = requests_retry_session()try: r = session.get(url)except SSLError: r = session.get(url, verify=False)```
Thank you so much Peter. I'll give it a go!
Comment
Great solution! How can it be adapted so that if the request fails for a SSL certificate issue it retries but this time with verify=false. I've also asked on Stackoverflow but receive no reply: https://stackoverflow.com/questions/62258005/requests-retry-with-verify-false-if-sslerror
Thanks for your help.
Replies
Something like this?
```
from requests.exceptions import SSLError
session = requests_retry_session()
try:
r = session.get(url)
except SSLError:
r = session.get(url, verify=False)
```
Thank you so much Peter. I'll give it a go!