Skip to content

DH key too short on the server side #7

@caniko

Description

@caniko

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 True

Note, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions