I've been working on a Node.js service that frequently connects to external servers through proxies. Over the past year, I've started encountering the following intermittent error :-
RequestError: C0CCD081227F0000:error:0A000438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1605:SSL alert number 80
As the proxies were dynamic and changed frequently, I couldn't pinpoint this issue immediately. The service often worked with retries, and there were backup systems in case it failed, so I never gave this a thorough look.
Recently, this error started occurring more frequently, so I had to investigate the issue. After some searching on various forums, someone hinted that it might be due to a mismatch between TLS versions.
With the help of AI tools, I discovered that you can use the HowIsMySSL service to check your proxy's SSL information. So, I gave that a try to filter proxies by their TLS version and only allow those with TLS v1.3 or higher.
1async function supportsTLSv3(proxy: Proxy): Promise<boolean> {
2 try {
3 const result = await axios
4 .get('https://www.howsmyssl.com/a/check', {
5 signal: AbortSignal.timeout(20000),
6 timeout: 20000,
7 proxy,
8 headers: {
9 Accept: 'application/json',
10 },
11 })
12 .then((resp) => resp.data);
13
14 const tlsVersion = result.tls_version;
15 return tlsVersion && tlsVersion.startsWith('TLS 1.3');
16 } catch {
17 return false;
18 }
19}