How to add custom certificate authority (CA) to nodejs

前端 未结 5 1087
失恋的感觉
失恋的感觉 2020-11-29 02:03

I\'m using a CLI tool to build hybrid mobile apps which has a cool upload feature so I can test the app on a device without going through the app store (it\'s ionic-cli). Ho

5条回答
  •  感动是毒
    2020-11-29 02:16

    Node.js 7.3.0 (and the LTS versions 6.10.0 and 4.8.0) added NODE_EXTRA_CA_CERTS environment variable for you to pass the CA certificate file. It will be safer than disabling certificate verification using NODE_TLS_REJECT_UNAUTHORIZED.

    $ export NODE_EXTRA_CA_CERTS=[your CA certificate file path]
    

提交回复
热议问题