Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

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

Open
adefirmanf opened this issue Jan 21, 2020 · 2 comments

Comments

@adefirmanf
Copy link

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 request/request#1777 and #28

Add rejectUnauthorized: false option solve the issue but the certificate file just do nothing in there.
request/request#1777 (comment)

So any other solution? Thanks

@misdanwijaya
Copy link

same problme here

@foxsnow38
Copy link

same problem here to

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants