ECONNREFUSED on attemp to connecto to untrusted https

212 views
Skip to first unread message

Darío Alejandro Guzik

unread,
Dec 2, 2011, 12:01:40 PM12/2/11
to zomb...@googlegroups.com
Hi!

Is there a way to accept untrusted connections from within a script?

I'm testing an js sdk that connects to https server to get data. I mocked the server sith a local nodejs server but when the script tries to get data it throws ECONNREFUSED on net.js. I guess it's related to site authentication. Is there a way to ommit that validation?

Thanks

Assaf Arkin

unread,
Dec 2, 2011, 12:06:10 PM12/2/11
to zomb...@googlegroups.com
ECONNREFUSED is a TCP error code. If you're trying to connect to a port, but there's nothing listening on it, you'll get that error code.

Matt Keeble

unread,
Dec 2, 2014, 1:13:49 PM12/2/14
to zomb...@googlegroups.com
I appreciate this is an OLD OLD post, but this is still a problem.

Zombie does not connect to a working, open and verified https port with an untrusted certificate. Curl, wget and the browser itself do connect to the same connection.

Setting process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0" doesn't solve the problem. I don't know if this is a problem with Zombie or with the underlying jsdom (I guess either is possible), but this is THE top result for a search of "Zombie https ECONNREFUSED" and you didn't even attempt to answer the problem. Do you have any further insight in the 3 years that have passed since the question was first asked?

Cheers,

as...@labnotes.org

unread,
Dec 2, 2014, 1:19:32 PM12/2/14
to zomb...@googlegroups.com
ECONNREFUSED because there’s nothing listening on that IP/port.

Since nothing is listening on that IP/port, it’s also not sending back any TLS certificate, so it doesn’t matter what value you use for  NODE_TLS_REJECT_UNAUTHORIZED.

I cannot answer why your server is not listening on that IP/port.


--
You received this message because you are subscribed to the Google Groups "zombie.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zombie-js+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Keeble

unread,
Dec 3, 2014, 7:15:35 AM12/3/14
to zomb...@googlegroups.com
I appreciate your response +Assaf, but I'm afraid your mistaken. The server IS listening on that port. I can verify this is the case in a number of ways.

Thanks anyway.

Matt Keeble

unread,
Dec 3, 2014, 8:22:50 AM12/3/14
to zomb...@googlegroups.com
Hey Assaf. OK - so it appears you are correct. After setting NODE_DEBUG=net I followed the output and it seems someone had buried a dummy API call in our codebase - the server didn't exist and once I had changed that to a working domain (google.com for example) my code runs.

Thanks for your help and I hope the updates on this thread help someone else with similar problems to stop blaming Zombie! :D

Cheers,

Matt
Reply all
Reply to author
Forward
0 new messages