smartAPI icon indicating copy to clipboard operation
smartAPI copied to clipboard

SSL error when accessing SmartAPI API from requests or httpx

Open newgene opened this issue 1 year ago • 2 comments

In [27]: requests.get("https://smart-api.info/api/metakg")

with this SSL error:

SSLError: HTTPSConnectionPool(host='smart-api.info', port=443): Max retries exceeded with url: /api/metakg (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:1129)')))

Same issue with httpx package.

Web browser works just fine. Must be SSL version issue, and web browser might be more tolerant.

newgene avatar Jun 19 '24 19:06 newgene

The smartapi is using HTTPS/TLS 1.3. It's the last version of the TLS.

In this case, the client needs to implement the TLS 1.3 to access it. Otherwise we get an error.

Another option is configuring the servers to accept older versions of TLS.

everaldorodrigo avatar Jun 24 '24 23:06 everaldorodrigo

If it's easy to add the support for older TLS version, e.g. a quick nginx conf change, it might be worth it, so older client can still work.

newgene avatar Jun 25 '24 03:06 newgene

@everaldorodrigo is this addressed?

newgene avatar Oct 07 '24 20:10 newgene

@newgene yes it was addressed. Now the application is using TLS 1.2 and 1.3.

everaldorodrigo avatar Oct 08 '24 17:10 everaldorodrigo