-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Tried to access the API by using the CLI file, get_swc.py; got this error:
No network connectivity. A working internet connection is required.
Check with ISP and/or your local network infrastructure for failure.
Did some digging for 5 minutes, and found that this occurs in rest_wrapper.py under check_api_health(). After some debugging, I found out that it is a URLError; your DH keys are too short! DH keys are used to create a secure SSL connection, and I think the standard size of these keys have been increased since the creation of this API. The underlying network libraries no longer accept these short keys.
Found this:
https://stackoverflow.com/questions/64354210/python-dh-key-too-small-which-side-is-faulty
Short version: The issue seems to be in the server. Probably legacy software.
To repoduce with minimal work:
url = "http://neuromorpho.org/api/health"
req = Request(url)
response = urlopen(req) # <---- should crash here
if json.loads(response.read().decode('utf-8'))['status'] != "UP":
print("REST API not available.")
else:
return TrueNote, that I can open http://neuromorpho.org/api/health in the browser, and I do get "status": "UP". Meaning, the issue really is with the DH keys.