{"action":"created","issue":{"url":"https://api.github.com/repos/nodejitsu/node-http-proxy/issues/782","labels_url":"https://api.github.com/repos/nodejitsu/node-http-proxy/issues/782/labels{/name}","comments_url":"https://api.github.com/repos/nodejitsu/node-http-proxy/issues/782/comments","events_url":"https://api.github.com/repos/nodejitsu/node-http-proxy/issues/782/events","html_url":"https://github.com/nodejitsu/node-http-proxy/issues/782","id":58431737,"number":782,"title":"https client error on valid certificate","user":{"login":"coolaj86","id":122831,"avatar_url":"https://avatars.githubusercontent.com/u/122831?v=3","gravatar_id":"","url":"https://api.github.com/users/coolaj86","html_url":"https://github.com/coolaj86","followers_url":"https://api.github.com/users/coolaj86/followers","following_url":"https://api.github.com/users/coolaj86/following{/other_user}","gists_url":"https://api.github.com/users/coolaj86/gists{/gist_id}","starred_url":"https://api.github.com/users/coolaj86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolaj86/subscriptions","organizations_url":"https://api.github.com/users/coolaj86/orgs","repos_url":"https://api.github.com/users/coolaj86/repos","events_url":"https://api.github.com/users/coolaj86/events{/privacy}","received_events_url":"https://api.github.com/users/coolaj86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-21T01:03:12Z","updated_at":"2015-12-07T20:42:58Z","closed_at":null,"body":"I have an incoming request for `mydomain.com` which I want to proxy on the private network to `10.0.10.5`.\r\n\r\n```javascript\r\n  return function (req, res, next) {\r\n    var proxy = httpProxy.createProxyServer();\r\n\r\n    proxy.web(req, res, {\r\n      target: {\r\n        protocol: 'https:'\r\n      , hostname: '10.0.10.5'\r\n      , port: '8443'\r\n      , ca: caArr\r\n      }\r\n    // for testing only\r\n    //, secure: false\r\n    });\r\n  };\r\n```\r\n\r\nIt fails with this error:\r\n\r\n```\r\n[Error: Hostname/IP doesn't match certificate's altnames]\r\n```\r\n\r\nI find that a little weird because the certificate *does* match *mydomain.com*. But for some reason it doesn't like that I'm accessing it as `10.0.10.5`. I would have thought that the fact that the `Host` header is set correctly to *mydomain.com* would have made addressing it directly by IP not an issue.\r\n\r\nHowever, if I manually edit `/etc/hosts` on the web-facing `mydomain.com` so that it sees `mydomain.com` as `10.0.10.5` like this, it works:\r\n\r\n```javascript\r\n```javascript\r\n  return function (req, res, next) {\r\n    var proxy = httpProxy.createProxyServer();\r\n\r\n    proxy.web(req, res, {\r\n      target: {\r\n        protocol: 'https:'\r\n      , hostname: 'mydomain.com'\r\n      , port: '8443'\r\n      , ca: caArr\r\n      }\r\n    });\r\n  };\r\n```\r\n\r\nThe best thing I can think of to do (aside from `secure: false`, which I do not want to do) is to give a subdomain `proxyable.mydomain.com` and on the server that receives the request I just strip out `proxyable` before the vhost middleware gets a chance to handle it (otherwise the json api might return strings with *proxyable.mydomain.com* back out to the user and cause api problems in the web interface).\r\n\r\nIs there an option that can be passed to tell it to verify against the Host header instead of the hostname?"},"comment":{"url":"https://api.github.com/repos/nodejitsu/node-http-proxy/issues/comments/162655921","html_url":"https://github.com/nodejitsu/node-http-proxy/issues/782#issuecomment-162655921","issue_url":"https://api.github.com/repos/nodejitsu/node-http-proxy/issues/782","id":162655921,"user":{"login":"jcrugzz","id":592149,"avatar_url":"https://avatars.githubusercontent.com/u/592149?v=3","gravatar_id":"","url":"https://api.github.com/users/jcrugzz","html_url":"https://github.com/jcrugzz","followers_url":"https://api.github.com/users/jcrugzz/followers","following_url":"https://api.github.com/users/jcrugzz/following{/other_user}","gists_url":"https://api.github.com/users/jcrugzz/gists{/gist_id}","starred_url":"https://api.github.com/users/jcrugzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcrugzz/subscriptions","organizations_url":"https://api.github.com/users/jcrugzz/orgs","repos_url":"https://api.github.com/users/jcrugzz/repos","events_url":"https://api.github.com/users/jcrugzz/events{/privacy}","received_events_url":"https://api.github.com/users/jcrugzz/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T20:42:58Z","updated_at":"2015-12-07T20:42:58Z","body":"@indutny any idea what could have caused this? Would love to know if its a bug in `http-proxy` that im not accounting for based on a node core change."}}