Strange issue with http Reqeust node

Hey everyone, I’m running into a pretty strange issue with an HTTP Request node.

The request is supposed to call an HTTPS API, but instead of getting a response, n8n eventually fails with a 502 Bad Gateway. The error mentions something around the TLS connection timing out.

I’ve already checked the URL and the endpoint is reachable from the server, so I’m not really sure if this is an n8n issue, Node.js, or something happening between n8n and the API.

Hey @Juan_Pablo1, while you wait for a response, here are some things that might help:

Suggested resources

Automatically matched to your question.

Docs:

Forum:

@Websensepro, @Florian_Delbes - you’ve helped with similar issues before, can you take a look?

Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.

I’ve run into TLS timeout issues before with the HTTP Request node. Usually it’s either a certificate problem or the server taking too long to complete the handshake.

Can you share the exact error message you’re seeing? Also what version of n8n are you running and is this self hosted or cloud?

If the endpoint works fine from curl on the same server that might point to something in n8n’s request config or a Node.js TLS setting.

@Juan_Pablo1 Before we start please share your screen?

@Juan_Pablo1

A 502 combined with a TLS handshake timeout usually points more toward the connection being dropped before the HTTPS session is fully established, rather than the API returning a normal application-level error.

A few things I’d check first:

Whether the API is behind a reverse proxy or load balancer
Whether the n8n container can establish a TLS connection to the host
DNS resolution from inside the n8n container
Whether there’s a proxy/firewall between n8n and the API
The HTTP Request node’s timeout value
Whether the problem happens consistently or only after the request has been idle for some time

I wouldn’t immediately start changing TLS verification settings or disabling certificate validation. That can hide the actual problem.

Can you share two screenshots for me?

The HTTP Request node’s Output/Error panel
The n8n container terminal/log output from the same execution

Especially the complete error stack around ERR_TLS_HANDSHAKE_TIMEOUT.

Yeah please check this are my screenshots


Yep @Juan_Pablo1 Top of the day to you! , this gives us a lot more to work with.

The important part isn’t really the 502 itself. The deeper error is:

ERR_TLS_HANDSHAKE_TIMEOUT
Client network socket disconnected before secure TLS connection was established.

And the stack shows the failure happening while Node’s HTTPS client is trying to establish the connection.

I’d troubleshoot this from inside the n8n container, rather than changing the workflow first.

Try:

docker exec -it n8n-1 sh

Then test DNS resolution:

getent hosts api.example.com

and test the TLS handshake directly:

openssl s_client -connect api.example.com:443 -servername api.example.com

If that hangs or fails from inside the container while the same command works normally on the host, then the problem is most likely somewhere in the container’s network path, proxy, firewall, or DNS configuration.

I’d also temporarily increase the HTTP Request node timeout from 30s to something like 60s just to determine whether this is genuinely a slow handshake or an immediate network termination.

Don’t disable TLS certificate verification yet. The log is showing a handshake timeout, not a certificate-validation error, so disabling verification wouldn’t address the underlying failure.

If the openssl s_client test also hangs, send that output too. That should tell us whether we’re dealing with n8n/Axios specifically or a lower-level connection problem.

hmm let me try that thank you