NodeJS UNABLE_TO_VERIFY_LEAF_SIGNATURE

前端 未结 7 1495
鱼传尺愫
鱼传尺愫 2021-02-04 00:36

We\'re trying to use Node.js (and Mocha) as a testing framework to test API calls against an internal server over https. We\'re using the following node modules: Mocha, Restify

7条回答
  •  [愿得一人]
    2021-02-04 00:58

    I had got the same problem of rest of mine done by https. When I connect with my node clients I obtain those error. The solution for me is to use intermediate certificate.

    var key_content  =     fs.readFileSync('./resources/certificates/foo/foo.es_private_key.key');
    var cert_content =  fs.readFileSync('./resources/certificates/foo/foo.es_ssl_certificate.crt');
    var ca_content   =  fs.readFileSync('./resources/certificates/foo/_.foo.es_ssl_certificate_INTERMEDIATE.crt');
    
    var options = {
      key:  key_content,
      cert: cert_content,
      ca: ca_content
    };
    
    var server = https.createServer(options, app);
    

提交回复
热议问题