SSL Error using virtualmin api

OS type and version Ubuntu 22.04.1
Webmin version 2.013
Virtualmin version 7.50pro

When trying to access the remote api via either curl or python’s request library I get an SSL error.

In python:

    url = f"https://{args.server}:10000/virtual-server/remote.cgi?program=list-domains"
    resp = requests.get(url,auth=(args.user, args.password))

results in

ssl.SSLError: ("read error: Error([('SSL routines', '', 'unexpected eof while reading')])",)

From wget:

wget --http-user root --http-passwd='<redacted>' 'https://<redacted>:10000/virtual-server/remote.cgi?program=list-domains'

results in a loop of:

2023-01-25 18:29:54 (31.8 KB/s) - Read error at byte 3214 (The TLS connection was non-properly terminated.).Retrying.

wget does return output, but the SSL exception means I can’t access the response body in python.

Any suggestions as to how to fix this?

Further information - the ssl certificate is from letsencrypt and is valid.

Not a full solution, but a workaround, if you just need to use / test the API urgently, and want to look later on for the SSL issue:

You can use wget with skipping ssl-check with parameter: --no-check-certificate

The SSL cert is valid, and the error occurs even if validation is turned off.

For now I’m just tunneling over ssh and running the cli.