Преглед на файлове

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`.