Client certificate validation on server side, DEPTH_ZERO_SELF_SIGNED_CERT error

后端 未结 7 1214
不知归路
不知归路 2020-12-09 16:34

I\'m using node 0.10.26 and trying to establish https connection with client validation.

Server\'s code:

var https = require(\'https\');
var fs = req         


        
相关标签:
7条回答
  • 2020-12-09 17:24

    If you have only a .pem self-signed certificate (e.g. /tmp/ca-keyAndCert.pem) the following options will work:

    var options = {
          url: 'https://<MYHOST>:<MY_PORT>/',
          key: fs.readFileSync('/tmp/ca-keyAndCert.pem'),
          cert: fs.readFileSync('/tmp/ca-keyAndCert.pem'),
          requestCert: false,
          rejectUnauthorized: false
    };
    
    0 讨论(0)
提交回复
热议问题