{"action":"created","comment":{"url":"https://api.github.com/repos/tessel/runtime/pulls/comments/23274969","id":23274969,"diff_hunk":"@@ -163,7 +147,17 @@ TCPSocket.prototype.connect = function (/*options | [port], [host], [cb]*/) {\n \n   function setUpConnection(ip) {\n     if (self.socket == null) {\n-      if (self._secure) ensureSSLCtx();\n+      if (self._secure) {\n+        var custom_certs = null;\n+        self._ssl_checkCerts = (opts.rejectUnauthorized !== false);\n+        if (opts.ca) custom_certs = opts.ca.map(function (pem_data) {","path":"src/colony/modules/net.js","position":31,"original_position":31,"commit_id":"42442cc261fa5fc1ec62bec58d9651a022dd8c4c","original_commit_id":"42442cc261fa5fc1ec62bec58d9651a022dd8c4c","user":{"login":"tcr","id":80639,"avatar_url":"https://avatars.githubusercontent.com/u/80639?v=3","gravatar_id":"","url":"https://api.github.com/users/tcr","html_url":"https://github.com/tcr","followers_url":"https://api.github.com/users/tcr/followers","following_url":"https://api.github.com/users/tcr/following{/other_user}","gists_url":"https://api.github.com/users/tcr/gists{/gist_id}","starred_url":"https://api.github.com/users/tcr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcr/subscriptions","organizations_url":"https://api.github.com/users/tcr/orgs","repos_url":"https://api.github.com/users/tcr/repos","events_url":"https://api.github.com/users/tcr/events{/privacy}","received_events_url":"https://api.github.com/users/tcr/received_events","type":"User","site_admin":false},"body":"Recommend braces :)","created_at":"2015-01-21T02:43:01Z","updated_at":"2015-01-21T02:43:01Z","html_url":"https://github.com/tessel/runtime/pull/703#discussion_r23274969","pull_request_url":"https://api.github.com/repos/tessel/runtime/pulls/703","_links":{"self":{"href":"https://api.github.com/repos/tessel/runtime/pulls/comments/23274969"},"html":{"href":"https://github.com/tessel/runtime/pull/703#discussion_r23274969"},"pull_request":{"href":"https://api.github.com/repos/tessel/runtime/pulls/703"}}},"pull_request":{"url":"https://api.github.com/repos/tessel/runtime/pulls/703","id":27473490,"html_url":"https://github.com/tessel/runtime/pull/703","diff_url":"https://github.com/tessel/runtime/pull/703.diff","patch_url":"https://github.com/tessel/runtime/pull/703.patch","issue_url":"https://api.github.com/repos/tessel/runtime/issues/703","number":703,"state":"open","locked":false,"title":"Support TLS `ca` and `rejectUnauthorized` options (connect to self-signed servers)","user":{"login":"natevw","id":265902,"avatar_url":"https://avatars.githubusercontent.com/u/265902?v=3","gravatar_id":"","url":"https://api.github.com/users/natevw","html_url":"https://github.com/natevw","followers_url":"https://api.github.com/users/natevw/followers","following_url":"https://api.github.com/users/natevw/following{/other_user}","gists_url":"https://api.github.com/users/natevw/gists{/gist_id}","starred_url":"https://api.github.com/users/natevw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natevw/subscriptions","organizations_url":"https://api.github.com/users/natevw/orgs","repos_url":"https://api.github.com/users/natevw/repos","events_url":"https://api.github.com/users/natevw/events{/privacy}","received_events_url":"https://api.github.com/users/natevw/received_events","type":"User","site_admin":false},"body":"This improves the TLS module's node.js compatibility regarding (remote) server certificate handling (i.e. when Tessel is the client).\r\n\r\n- support `{rejectUnauthorized:false}` option, aka enable cheap MITM attacks [useful for development and careless people]\r\n- support custom CA lists [useful for validating self-signed certs or own set of trusted roots]\r\n- `tlsSocket.getPeerCertificate()` is now sort of implemented for non-detailed info (even that is probably not 100% compatible with whatever undocumented fields node.js provides, but presumedly better than nuffins)\r\n- also fixed a bug where a server certificate that didn't contain subjectaltnames would always be rejected","created_at":"2015-01-15T23:52:06Z","updated_at":"2015-01-21T02:43:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6726d44d8a7687b3d669504e3df59083920b60c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tessel/runtime/pulls/703/commits","review_comments_url":"https://api.github.com/repos/tessel/runtime/pulls/703/comments","review_comment_url":"https://api.github.com/repos/tessel/runtime/pulls/comments/{number}","comments_url":"https://api.github.com/repos/tessel/runtime/issues/703/comments","statuses_url":"https://api.github.com/repos/tessel/runtime/statuses/42442cc261fa5fc1ec62bec58d9651a022dd8c4c","head":{"label":"natevw:nvw-tls-options","ref":"nvw-tls-options","sha":"42442cc261fa5fc1ec62bec58d9651a022dd8c4c","user":{"login":"natevw","id":265902,"avatar_url":"https://avatars.githubusercontent.com/u/265902?v=3","gravatar_id":"","url":"https://api.github.com/users/natevw","html_url":"https://github.com/natevw","followers_url":"https://api.github.com/users/natevw/followers","following_url":"https://api.github.com/users/natevw/following{/other_user}","gists_url":"https://api.github.com/users/natevw/gists{/gist_id}","starred_url":"https://api.github.com/users/natevw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natevw/subscriptions","organizations_url":"https://api.github.com/users/natevw/orgs","repos_url":"https://api.github.com/users/natevw/repos","events_url":"https://api.github.com/users/natevw/events{/privacy}","received_events_url":"https://api.github.com/users/natevw/received_events","type":"User","site_admin":false},"repo":{"id":22082913,"name":"tessel-runtime","full_name":"natevw/tessel-runtime","owner":{"login":"natevw","id":265902,"avatar_url":"https://avatars.githubusercontent.com/u/265902?v=3","gravatar_id":"","url":"https://api.github.com/users/natevw","html_url":"https://github.com/natevw","followers_url":"https://api.github.com/users/natevw/followers","following_url":"https://api.github.com/users/natevw/following{/other_user}","gists_url":"https://api.github.com/users/natevw/gists{/gist_id}","starred_url":"https://api.github.com/users/natevw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natevw/subscriptions","organizations_url":"https://api.github.com/users/natevw/orgs","repos_url":"https://api.github.com/users/natevw/repos","events_url":"https://api.github.com/users/natevw/events{/privacy}","received_events_url":"https://api.github.com/users/natevw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/natevw/tessel-runtime","description":"Tessel JS runtime","fork":true,"url":"https://api.github.com/repos/natevw/tessel-runtime","forks_url":"https://api.github.com/repos/natevw/tessel-runtime/forks","keys_url":"https://api.github.com/repos/natevw/tessel-runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/natevw/tessel-runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/natevw/tessel-runtime/teams","hooks_url":"https://api.github.com/repos/natevw/tessel-runtime/hooks","issue_events_url":"https://api.github.com/repos/natevw/tessel-runtime/issues/events{/number}","events_url":"https://api.github.com/repos/natevw/tessel-runtime/events","assignees_url":"https://api.github.com/repos/natevw/tessel-runtime/assignees{/user}","branches_url":"https://api.github.com/repos/natevw/tessel-runtime/branches{/branch}","tags_url":"https://api.github.com/repos/natevw/tessel-runtime/tags","blobs_url":"https://api.github.com/repos/natevw/tessel-runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/natevw/tessel-runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/natevw/tessel-runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/natevw/tessel-runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/natevw/tessel-runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/natevw/tessel-runtime/languages","stargazers_url":"https://api.github.com/repos/natevw/tessel-runtime/stargazers","contributors_url":"https://api.github.com/repos/natevw/tessel-runtime/contributors","subscribers_url":"https://api.github.com/repos/natevw/tessel-runtime/subscribers","subscription_url":"https://api.github.com/repos/natevw/tessel-runtime/subscription","commits_url":"https://api.github.com/repos/natevw/tessel-runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/natevw/tessel-runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/natevw/tessel-runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/natevw/tessel-runtime/issues/comments/{number}","contents_url":"https://api.github.com/repos/natevw/tessel-runtime/contents/{+path}","compare_url":"https://api.github.com/repos/natevw/tessel-runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/natevw/tessel-runtime/merges","archive_url":"https://api.github.com/repos/natevw/tessel-runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/natevw/tessel-runtime/downloads","issues_url":"https://api.github.com/repos/natevw/tessel-runtime/issues{/number}","pulls_url":"https://api.github.com/repos/natevw/tessel-runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/natevw/tessel-runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/natevw/tessel-runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/natevw/tessel-runtime/labels{/name}","releases_url":"https://api.github.com/repos/natevw/tessel-runtime/releases{/id}","created_at":"2014-07-21T22:43:06Z","updated_at":"2014-07-21T22:43:51Z","pushed_at":"2015-01-20T20:28:23Z","git_url":"git://github.com/natevw/tessel-runtime.git","ssh_url":"git@github.com:natevw/tessel-runtime.git","clone_url":"https://github.com/natevw/tessel-runtime.git","svn_url":"https://github.com/natevw/tessel-runtime","homepage":"","size":18895,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tessel:master","ref":"master","sha":"f33115dd285c0808450afa09d918e028ee67386e","user":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"repo":{"id":14543043,"name":"runtime","full_name":"tessel/runtime","owner":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tessel/runtime","description":"Tessel JS runtime","fork":false,"url":"https://api.github.com/repos/tessel/runtime","forks_url":"https://api.github.com/repos/tessel/runtime/forks","keys_url":"https://api.github.com/repos/tessel/runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessel/runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessel/runtime/teams","hooks_url":"https://api.github.com/repos/tessel/runtime/hooks","issue_events_url":"https://api.github.com/repos/tessel/runtime/issues/events{/number}","events_url":"https://api.github.com/repos/tessel/runtime/events","assignees_url":"https://api.github.com/repos/tessel/runtime/assignees{/user}","branches_url":"https://api.github.com/repos/tessel/runtime/branches{/branch}","tags_url":"https://api.github.com/repos/tessel/runtime/tags","blobs_url":"https://api.github.com/repos/tessel/runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessel/runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessel/runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessel/runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessel/runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/tessel/runtime/languages","stargazers_url":"https://api.github.com/repos/tessel/runtime/stargazers","contributors_url":"https://api.github.com/repos/tessel/runtime/contributors","subscribers_url":"https://api.github.com/repos/tessel/runtime/subscribers","subscription_url":"https://api.github.com/repos/tessel/runtime/subscription","commits_url":"https://api.github.com/repos/tessel/runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessel/runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessel/runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessel/runtime/issues/comments/{number}","contents_url":"https://api.github.com/repos/tessel/runtime/contents/{+path}","compare_url":"https://api.github.com/repos/tessel/runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessel/runtime/merges","archive_url":"https://api.github.com/repos/tessel/runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessel/runtime/downloads","issues_url":"https://api.github.com/repos/tessel/runtime/issues{/number}","pulls_url":"https://api.github.com/repos/tessel/runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/tessel/runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/tessel/runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessel/runtime/labels{/name}","releases_url":"https://api.github.com/repos/tessel/runtime/releases{/id}","created_at":"2013-11-20T01:16:24Z","updated_at":"2015-01-16T18:27:32Z","pushed_at":"2015-01-20T21:41:56Z","git_url":"git://github.com/tessel/runtime.git","ssh_url":"git@github.com:tessel/runtime.git","clone_url":"https://github.com/tessel/runtime.git","svn_url":"https://github.com/tessel/runtime","homepage":"","size":28391,"stargazers_count":94,"watchers_count":94,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":140,"forks":26,"open_issues":140,"watchers":94,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tessel/runtime/pulls/703"},"html":{"href":"https://github.com/tessel/runtime/pull/703"},"issue":{"href":"https://api.github.com/repos/tessel/runtime/issues/703"},"comments":{"href":"https://api.github.com/repos/tessel/runtime/issues/703/comments"},"review_comments":{"href":"https://api.github.com/repos/tessel/runtime/pulls/703/comments"},"review_comment":{"href":"https://api.github.com/repos/tessel/runtime/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/tessel/runtime/pulls/703/commits"},"statuses":{"href":"https://api.github.com/repos/tessel/runtime/statuses/42442cc261fa5fc1ec62bec58d9651a022dd8c4c"}}}}