bisand / node-red-contrib-tibber-api

Node Red module for integrating with Tibber api
MIT License
20 stars 2 forks source link

global-agent/bootstrap #86

Closed Isaksson closed 10 months ago

Isaksson commented 1 year ago

Hello. I am developing a Node-RED module that is communicating with Unifi Console (HTTPS) but most of the time there is a self signed certificate created by the system so I have added an option in my Node to ignore certificate warnings (rejectUnauthorized). I have received several Issues from users that they could not connect and they receive "DEPTH_ZERO_SELF_SIGNED_CERT" that is the exact error message that you would receive if you use option rejectUnauthorized = true, I could never reproduce the error in my environments (several of them). But now we have finally located the issue and its caused by your Node "node-red-contrib-tibber-api" as soon as you install this node then the issue starts, if you disable it then everything starts to work again. I took a little peek of your could and noticed that you use the proxy Global-Agent, do you need that one or is it just some leftovers from some tests? When I comment out "require ('global-agent/bootstrap');" in your code so that the Proxy is not loaded then the issue is gone, so its the proxy that is "hijacking" the requests from my Node as well.

Let me know your thoughts about this and maybe we could find a solution so that both our Node could work at the same time in Node-RED.

bisand commented 11 months ago

Hi, I'm sorry for the very late response. I see that the problem you are experiencing is caused by the "global-agent" you mentioned, introduced in this PR: https://github.com/bisand/node-red-contrib-tibber-api/pull/74

Since it causes problem I will revert this change and publish a new version. This will of course make the proxy fail again, but that can be fixed later.

bisand commented 11 months ago

A new version is published, and should be available soon. Hope this solves the problems you are experiencing.

Isaksson commented 11 months ago

Hello. Thanks for this fix, now I don't have to recommend users to modify the files by them self to disable the proxy.