0

Using python 3.11 On MacOS Ventura 13.4.1 M1 chip

I am writing a python script that will access a V1 API endpoint using a get method but I keep running into the below error.

requests.exceptions.SSLError: HTTPSConnectionPool(host=10.0.0.1, port=443): Max retries exceeded with url: /api/config (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1002)')))

Below is a snippet of the code I am using.

ip = "10.0.0.1" (example IP)
credentials = ("admin", password)
response = requests.get(url=f"https://{ip}/api/config", auth=credentials, verify=False)

The head scratcher for me is when the same script is run on a windows machine it works fine, does not seem to be a specifc machine issue. I tried a few different macs and windows for fun and it followed the same result.

Most of what I am reading online is to use the "verify=False" argument which I have specified.

I've run the Install Certificates.commandon my mac from the python 3.11 folder in applications and it's confirmed that all requirements have been met. I've run an upgrade on pip too as well as a last ditch effort. Any guidance would be appreciated!

Peter92
  • 1
  • 1
  • Does this answer your question? [Max retries exceeded with URL in requests](https://stackoverflow.com/questions/23013220/max-retries-exceeded-with-url-in-requests) –  Aug 08 '23 at 04:02

1 Answers1

0

I did some digging and I found this https://github.com/urllib3/urllib3/issues/3020

Seems like the underlying issue is that python 3.10+ on Mac removes LibreSSL support? Not sure, to be completely honest most of whats on this page goes over my head but I downgraded to 3.10 (Issue still exists) and then down to 3.9 and the issue was resolved.

To be honest downgrading to 3.9 is not ideal for me, but it's working now. I plan on re-reading the the above link again later when my brain is less fried to see if I can do anything to make it work on 3.11.

Figured I'd share this now incase it helps anyone else running into the same issue.

Peter92
  • 1
  • 1