4 ms·
> resolve whatever.localhost to 127.0.0.1 I think that's the browsers making names up. No system resolvers I've seen respond to an x.localhost lookup. I gener
by mhio 5y ago
> resolve whatever.localhost to 127.0.0.1
I think that's the browsers making names up. No system resolvers I've seen respond to an x.localhost lookup.
I generally have a wildcard setup on an internal domain for generic local names (*.local.me)
> Node also isn't able to use the system-wide certs store
Node can use the `NODE_EXTRA_CA_CERTS` environment variable to add a file of one or more PEM trusted certificates at launch.
https://nodejs.org/dist/latest-v16.x/docs/api/cli.html#node_extra_ca_certsfile https://nodejs.org/dist/latest-v16.x/docs/api/cli.html#node_...
- lewisl9029 5y ago> I think that's the browsers making names up. No system resolvers I've seen respond to an x.localhost lookup. Fair enough, I guess I just wish node would behave more like a browser in this case then, as it'd have saved me a lot of headache. > I generally have a wildcard setup on an internal domain for generic local names (*.local.me) Curious how you set that up? Hosts files don't allow wildcards afaik, and that's what I've been struggling with. > Node can use the `NODE_EXTRA_CA_CERTS` environment variable to add a file of one or more PEM trusted certificates at launch. I actually tried this option briefly but couldn't get it to work, at least not with the root cert that Caddy generated. I would much prefer a `NODE_USE_SYSTEM_CERTS` option that doesn't require pointing to any specific paths though, as there's less room for misconfiguration, which I can't rule out in my case.
- mhio 5y ago> Curious how you set that up? Via a DNS server we run, that then answers for local things or forwards requests on to the real world. To do that locally, set up a DNS forwarder like dnsmasq [0] or unbound [1] (or coredns/bind/etc) to respond for the domain you want to wildcard to localhost. Point your OS DNS settings to 127.0.0.1, then configure the forwarder with your regular external DNS servers. The equivalent to `NODE_USE_SYSTEM_CERTS` is a build time option unfortunately. I know the rhel/debian packages do integrate their builds with the system CA's but those packages tend to be ancient. Maybe try the nodesource [2] packaged node.js? The homebrew node formulae [3] looks like it integrates with the brew openssl CA's. [0] https://stackoverflow.com/a/22551303 https://stackoverflow.com/a/22551303 [1] https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#:~:text=for%20AAAA%20queries.-,redirect,-The%20query%20is https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound... [2] https://github.com/nodesource/distributions https://github.com/nodesource/distributions [3] https://github.com/Homebrew/homebrew-core/blob/c2579d98415bdc802ecc85e40af250f46a357037/Formula/node.rb#L96 https://github.com/Homebrew/homebrew-core/blob/c2579d98415bd...