{"action":"opened","issue":{"url":"https://api.github.com/repos/jaredhanson/passport-oauth1/issues/12","repository_url":"https://api.github.com/repos/jaredhanson/passport-oauth1","labels_url":"https://api.github.com/repos/jaredhanson/passport-oauth1/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/jaredhanson/passport-oauth1/issues/12/comments","events_url":"https://api.github.com/repos/jaredhanson/passport-oauth1/issues/12/events","html_url":"https://github.com/jaredhanson/passport-oauth1/issues/12","id":166890457,"number":12,"title":"Uncaught error event crashes process","user":{"login":"olalonde","id":416585,"avatar_url":"https://avatars.githubusercontent.com/u/416585?v=3","gravatar_id":"","url":"https://api.github.com/users/olalonde","html_url":"https://github.com/olalonde","followers_url":"https://api.github.com/users/olalonde/followers","following_url":"https://api.github.com/users/olalonde/following{/other_user}","gists_url":"https://api.github.com/users/olalonde/gists{/gist_id}","starred_url":"https://api.github.com/users/olalonde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olalonde/subscriptions","organizations_url":"https://api.github.com/users/olalonde/orgs","repos_url":"https://api.github.com/users/olalonde/repos","events_url":"https://api.github.com/users/olalonde/events{/privacy}","received_events_url":"https://api.github.com/users/olalonde/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-21T18:46:29Z","updated_at":"2016-07-21T18:46:29Z","closed_at":null,"body":"I was running my server locally and my laptop accidentally connected to one of those wifis which redirects all your http(s) requests. This resulted in this error:\r\n\r\n```javascript\r\nerror:  Error: self signed certificate\r\n    at Strategy.OAuthStrategy._createOAuthError (/Users/olalonde/code/myapp/myapp-api/node_modules/passport-oauth1/lib/strategy.js:396:17)\r\n    at /Users/olalonde/code/myapp/myapp-api/node_modules/passport-oauth1/lib/strategy.js:244:41\r\n    at /Users/olalonde/code/myapp/myapp-api/node_modules/oauth/lib/oauth.js:543:17\r\n    at ClientRequest.<anonymous> (/Users/olalonde/code/myapp/myapp-api/node_modules/oauth/lib/oauth.js:421:9)\r\n    at emitOne (events.js:96:13)\r\n    at ClientRequest.emit (events.js:188:7)\r\n    at TLSSocket.socketErrorListener (_http_client.js:306:9)\r\n    at emitOne (events.js:96:13)\r\n    at TLSSocket.emit (events.js:188:7)\r\n    at emitErrorNT (net.js:1265:8)\r\n    at _combinedTickCallback (internal/process/next_tick.js:74:11)\r\n    at process._tickDomainCallback (internal/process/next_tick.js:122:9)\r\nGET /v1/auth/connect/twitter 500 75.890 ms - 39\r\nevents.js:160\r\n      throw er; // Unhandled 'error' event\r\n      ^\r\n\r\nError: self signed certificate\r\n    at Error (native)\r\n    at TLSSocket.<anonymous> (_tls_wrap.js:1055:38)\r\n    at emitNone (events.js:86:13)\r\n    at TLSSocket.emit (events.js:185:7)\r\n    at TLSSocket._finishInit (_tls_wrap.js:580:8)\r\n    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:412:38)\r\n[nodemon] app crashed - waiting for file changes before starting...\r\n```\r\n\r\nI was wondering if there would be any way to catch this error so that it doesn't crash the whole process next time."}}
{"actor":{"display_login":"olalonde"}}