node-tunnel
node-tunnel copied to clipboard
Error : tunneling socket could not be established, cause=Hostname/IP does not match certificate's altnames
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
same problme here
same problem here to