Host acquires a certificate from an authority (let'sencrypt) for the domain specified in protocol, but it also adds a context with self-signed certificate for requests on localhost.
There requests are rejected by Nodejs by default, unless the generated cert is added to NODE_EXTRA_CA_CERTS, or authorization is disabled with NODE_TLS_REJECT_UNAUTHORIZED.
The TLS context method should be 'monkey-patched', or preferrably the custom CA specified explicitly on local requests to handle this issue programmatically, as described here:
https://link.medium.com/6xHYLeUVq5
Alternatively, addressing the local requests to the domain name with the trusted certificate could be a solution too.