{"action":"opened","issue":{"url":"https://api.github.com/repos/joyent/node/issues/19147","labels_url":"https://api.github.com/repos/joyent/node/issues/19147/labels{/name}","comments_url":"https://api.github.com/repos/joyent/node/issues/19147/comments","events_url":"https://api.github.com/repos/joyent/node/issues/19147/events","html_url":"https://github.com/joyent/node/issues/19147","id":70222935,"number":19147,"title":"Authorization Error: CERT_UNTRUSTED","user":{"login":"efkan","id":6974198,"avatar_url":"https://avatars.githubusercontent.com/u/6974198?v=3","gravatar_id":"","url":"https://api.github.com/users/efkan","html_url":"https://github.com/efkan","followers_url":"https://api.github.com/users/efkan/followers","following_url":"https://api.github.com/users/efkan/following{/other_user}","gists_url":"https://api.github.com/users/efkan/gists{/gist_id}","starred_url":"https://api.github.com/users/efkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efkan/subscriptions","organizations_url":"https://api.github.com/users/efkan/orgs","repos_url":"https://api.github.com/users/efkan/repos","events_url":"https://api.github.com/users/efkan/events{/privacy}","received_events_url":"https://api.github.com/users/efkan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-22T20:08:15Z","updated_at":"2015-04-22T20:08:15Z","closed_at":null,"body":"I think I've tried all ways however I couldn't get rid of the problem.\r\nI have got a trial SSL certificate from Comodo. It works on my web page without problem.\r\nWhen I try to request to my API server `connection.authorized` is false and `authorizationError` is `CERT_UNTRUSTED` every single time. \r\n\r\nI've read [tlsSocket.authorized][2] and [event 'SecureConnection'][3] explanations.\r\n>socket.authorized is a boolean value which indicates if the client has verified by one of the supplied certificate authorities for the server. If socket.authorized is false, then socket.authorizationError is set to describe how authorization failed.\r\n\r\nAlthough certificate's been attached `connection.authorized` is false.\r\n\r\nI'd like to know what can I do?\r\n\r\nMy question on [stackoverflow][1] regarding the issue\r\n\r\n\r\n\tvar https = require('https');\r\n\tvar fs = require('fs');\r\n\r\n\tvar options = {\r\n\t\tkey: fs.readFileSync('key.pem'),\r\n\t\tcert: fs.readFileSync('cert.pem'),\r\n\t\tca: fs.readFileSync('ca.pem'),\r\n\r\n\t\trejectUnauthorized: false,\r\n\r\n\t\thostname: 'api.mydomain.com',\r\n\t\tport: 443,\r\n\t\tpath: '/',\r\n\t\tmethod: 'GET',\r\n\t};\r\n\r\n\tvar req = https.request(options, function(res) {\r\n\r\n\t\tconsole.log(\"res.connection.authorized: \", res.connection.authorized);\r\n\r\n\t\tif(!res.connection.authorized) {\r\n\t\t  \tconsole.log('Authorization error: ' + res.connection.authorizationError);  \r\n\t\t}\r\n\r\n\t\tconsole.log(\"headers: \", res.headers);\r\n\r\n\t})\r\n\r\n\treq.end();\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n[1]: http://stackoverflow.com/q/29801300/3765109\r\n[2]: https://nodejs.org/api/tls.html#tls_tlssocket_authorized\r\n[3]: https://nodejs.org/api/tls.html#tls_event_secureconnection"}}