RHEL Note: If you happen to be using a RHEL based distro and the RHEL packaged nodejs/npm you can use the standard update-ca-trust method as RedHat points their packages at the system CA's. Strangely, I was looking at the documentation for ca and couldnt figure out how to use it to set a new ca, and all the references for npm config set ca were to set it to '' or null, to get around the CA switch back in February. npm folders npm config config package. othiym23 - thanks for the pointer to cafile, I think that might do the trick for me. This is primarily for distribution maintainers to override default configs in a standard and consistent manner. Unfortunately npm's CA bundle is not editable as it's provided in the source code (thanks tomekwi) but nitzel has provided a generic Node.js method to append a certificate via the NODE_EXTRA_CA_CERTS environment variable. This is an unchangeable 'builtin' configuration file that npm keeps consistent across updates. If you need to support both public https npm registries as well as your own, you could use curl's Mozilla based CA bundle and append your CA cert to the cacert.pem file: curl > ~/. If you try and use any public npm registries via https that aren't signed by your CA certificate, you will get errors. Similar to the ca setting, but allows for multiple CAs, as well as for. Note: these CA settings will override the default "real world" certificate authority lookups that npm uses. A path to a file containing one or multiple Certificate Authority signing certificates. The npm config commands above will persist the relevant config items to your ~/.npmrc file: cafile=/path/to/cert.pem npm config set ca "cert string"Ĭa can be an array of cert strings too. You can also configure ca string(s) directly. You can point npm to a cafile npm config set cafile /path/to/cert.pem
0 Comments
Leave a Reply. |