Переглянути джерело

Document NODE_EXTRA_CA_CERTS for Node.js

Fixes #78
Filippo Valsorda 6 роки тому
батько
коміт
7fbb1febce
1 змінених файлів з 8 додано та 0 видалено
  1. 8 0
      README.md

+ 8 - 0
README.md

@@ -126,6 +126,14 @@ On iOS, you can either use AirDrop, email the CA to yourself, or serve it from a
 
 For Android, you will have to install the CA and then enable user roots in the development build of your app. See [this StackOverflow answer](https://stackoverflow.com/a/22040887/749014).
 
+### Using the root with Node.js
+
+Node does not use the system root store, so it won't accept mkcert certificates automatically. Instead, you will have to set the [`NODE_EXTRA_CA_CERTS`](https://nodejs.org/api/cli.html#cli_node_extra_ca_certs_file) environment variable.
+
+```
+export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem"
+```
+
 ### Changing the location of the CA files
 
 The CA certificate and its key are stored in an application data folder in the user home. You usually don't have to worry about it, as installation is automated, but the location is printed by `mkcert -CAROOT`.