node-tunnel icon indicating copy to clipboard operation
node-tunnel copied to clipboard

Error : tunneling socket could not be established, cause=Hostname/IP does not match certificate's altnames

Open adefirmanf opened this issue 5 years ago • 2 comments

Hey, I got the following an error. tunneling socket could not be established, cause=Hostname/IP does not match certificate's altnames

Here my code :

const tunnellingAgent = tunnel.httpsOverHttps({
  proxy: {
    ca: [fs.readFileSync('ca.pem')],
    host: "targetHost.com",
    port: 3129,
    proxyAuth: "user:pass",
  }
})

const options = {
  host: "api.ipify.org",
  url: "https://api.ipify.org/?format=text",
  method: "GET",
  agent: tunnellingAgent,
  checkServerIdentity: function (host, err) { }
}

R(options, (err, res) => {
  console.log(err)
  console.log(res)
})

The error seems similar to this issue https://github.com/request/request/issues/1777 and https://github.com/koichik/node-tunnel/issues/28

Add rejectUnauthorized: false option solve the issue but the certificate file just do nothing in there. https://github.com/request/request/issues/1777#issuecomment-321024249

So any other solution? Thanks

adefirmanf avatar Jan 21 '20 15:01 adefirmanf

same problme here

misdanwijaya avatar Oct 13 '20 07:10 misdanwijaya

same problem here to

foxsnow38 avatar Jun 16 '22 11:06 foxsnow38