{"action":"created","comment":{"url":"https://api.github.com/repos/letsencrypt/boulder/pulls/comments/66673546","id":66673546,"diff_hunk":"@@ -0,0 +1,70 @@\n+package grpc\n+\n+import (\n+\t\"crypto/tls\"\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"net\"\n+\t\"time\"\n+\n+\t\"golang.org/x/net/context\"\n+\t\"google.golang.org/grpc/credentials\"\n+)\n+\n+// MultiNameAuthenticator does a thing\n+type MultiNameAuthenticator struct {\n+\tnames map[string]*tls.Config\n+}\n+\n+// NewMultiNameTLS also does a thing\n+func NewMultiNameTLS(names map[string]*tls.Config) credentials.TransportAuthenticator {\n+\treturn &MultiNameAuthenticator{names}\n+}\n+\n+func (mna *MultiNameAuthenticator) ClientHandshake(addr string, rawConn net.Conn, timeout time.Duration) (net.Conn, credentials.AuthInfo, error) {\n+\tvar errChannel chan error\n+\tif timeout != 0 {\n+\t\terrChannel = make(chan error, 2)\n+\t\ttime.AfterFunc(timeout, func() {\n+\t\t\terrChannel <- errors.New(\"boulder/grpc: Dial timed out\")\n+\t\t})\n+\t}\n+\tconfig, present := mna.names[addr]\n+\tif !present {\n+\t\treturn nil, nil, fmt.Errorf(\"boulder/grpc: Unexpected name, no TLS configuration present for \\\"%s\\\"\", addr)\n+\t}\n+\tconn := tls.Client(rawConn, config)\n+\tvar err error\n+\tif timeout == 0 {\n+\t\terr = conn.Handshake()\n+\t} else {\n+\t\tgo func() {\n+\t\t\terrChannel <- conn.Handshake()\n+\t\t}()\n+\t\terr = <-errChannel\n+\t}\n+\tif err != nil {\n+\t\t_ = rawConn.Close()\n+\t\treturn nil, nil, err\n+\t}\n+\treturn conn, nil, nil\n+}\n+\n+func (mna *MultiNameAuthenticator) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) {\n+\treturn nil, nil, fmt.Errorf(\"boulder/grpc: Server-side handshakes are not implemented\")\n+}\n+\n+func (mna *MultiNameAuthenticator) Info() credentials.ProtocolInfo {\n+\treturn credentials.ProtocolInfo{\n+\t\tSecurityProtocol: \"tls\",\n+\t\tSecurityVersion:  \"1.2\",\n+\t}\n+}\n+\n+func (mna *MultiNameAuthenticator) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {\n+\treturn nil, nil\n+}\n+\n+func (mna *MultiNameAuthenticator) RequireTransportSecurity() bool {","path":"grpc/transport-auth.go","position":68,"original_position":68,"commit_id":"a6278c1edef7d216c0f9923f2bd314441a1a3df2","original_commit_id":"a6278c1edef7d216c0f9923f2bd314441a1a3df2","user":{"login":"jsha","id":220205,"avatar_url":"https://avatars.githubusercontent.com/u/220205?v=3","gravatar_id":"","url":"https://api.github.com/users/jsha","html_url":"https://github.com/jsha","followers_url":"https://api.github.com/users/jsha/followers","following_url":"https://api.github.com/users/jsha/following{/other_user}","gists_url":"https://api.github.com/users/jsha/gists{/gist_id}","starred_url":"https://api.github.com/users/jsha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsha/subscriptions","organizations_url":"https://api.github.com/users/jsha/orgs","repos_url":"https://api.github.com/users/jsha/repos","events_url":"https://api.github.com/users/jsha/events{/privacy}","received_events_url":"https://api.github.com/users/jsha/received_events","type":"User","site_admin":false},"body":"My mental linter says all of these exported funcs should have comments.","created_at":"2016-06-10T20:07:53Z","updated_at":"2016-06-10T20:07:53Z","html_url":"https://github.com/letsencrypt/boulder/pull/1918#discussion_r66673546","pull_request_url":"https://api.github.com/repos/letsencrypt/boulder/pulls/1918","_links":{"self":{"href":"https://api.github.com/repos/letsencrypt/boulder/pulls/comments/66673546"},"html":{"href":"https://github.com/letsencrypt/boulder/pull/1918#discussion_r66673546"},"pull_request":{"href":"https://api.github.com/repos/letsencrypt/boulder/pulls/1918"}}},"pull_request":{"url":"https://api.github.com/repos/letsencrypt/boulder/pulls/1918","id":73296955,"html_url":"https://github.com/letsencrypt/boulder/pull/1918","diff_url":"https://github.com/letsencrypt/boulder/pull/1918.diff","patch_url":"https://github.com/letsencrypt/boulder/pull/1918.patch","issue_url":"https://api.github.com/repos/letsencrypt/boulder/issues/1918","number":1918,"state":"open","locked":false,"title":"Allow gRPC clients to connect to multiple backends","user":{"login":"rolandshoemaker","id":5080674,"avatar_url":"https://avatars.githubusercontent.com/u/5080674?v=3","gravatar_id":"","url":"https://api.github.com/users/rolandshoemaker","html_url":"https://github.com/rolandshoemaker","followers_url":"https://api.github.com/users/rolandshoemaker/followers","following_url":"https://api.github.com/users/rolandshoemaker/following{/other_user}","gists_url":"https://api.github.com/users/rolandshoemaker/gists{/gist_id}","starred_url":"https://api.github.com/users/rolandshoemaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolandshoemaker/subscriptions","organizations_url":"https://api.github.com/users/rolandshoemaker/orgs","repos_url":"https://api.github.com/users/rolandshoemaker/repos","events_url":"https://api.github.com/users/rolandshoemaker/events{/privacy}","received_events_url":"https://api.github.com/users/rolandshoemaker/received_events","type":"User","site_admin":false},"body":"Fixes #1917  and #1755, also updates `google.golang.org/grpc` to b60d3e9e.\r\n\r\nWould be interested in hearing thoughts on how best to test this.","created_at":"2016-06-09T22:31:12Z","updated_at":"2016-06-10T20:07:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9820c7f117df01501e0b004acbd7cced8339b1e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/letsencrypt/boulder/pulls/1918/commits","review_comments_url":"https://api.github.com/repos/letsencrypt/boulder/pulls/1918/comments","review_comment_url":"https://api.github.com/repos/letsencrypt/boulder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/letsencrypt/boulder/issues/1918/comments","statuses_url":"https://api.github.com/repos/letsencrypt/boulder/statuses/a6278c1edef7d216c0f9923f2bd314441a1a3df2","head":{"label":"letsencrypt:grpc-balancer","ref":"grpc-balancer","sha":"a6278c1edef7d216c0f9923f2bd314441a1a3df2","user":{"login":"letsencrypt","id":9289019,"avatar_url":"https://avatars.githubusercontent.com/u/9289019?v=3","gravatar_id":"","url":"https://api.github.com/users/letsencrypt","html_url":"https://github.com/letsencrypt","followers_url":"https://api.github.com/users/letsencrypt/followers","following_url":"https://api.github.com/users/letsencrypt/following{/other_user}","gists_url":"https://api.github.com/users/letsencrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/letsencrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letsencrypt/subscriptions","organizations_url":"https://api.github.com/users/letsencrypt/orgs","repos_url":"https://api.github.com/users/letsencrypt/repos","events_url":"https://api.github.com/users/letsencrypt/events{/privacy}","received_events_url":"https://api.github.com/users/letsencrypt/received_events","type":"Organization","site_admin":false},"repo":{"id":28283593,"name":"boulder","full_name":"letsencrypt/boulder","owner":{"login":"letsencrypt","id":9289019,"avatar_url":"https://avatars.githubusercontent.com/u/9289019?v=3","gravatar_id":"","url":"https://api.github.com/users/letsencrypt","html_url":"https://github.com/letsencrypt","followers_url":"https://api.github.com/users/letsencrypt/followers","following_url":"https://api.github.com/users/letsencrypt/following{/other_user}","gists_url":"https://api.github.com/users/letsencrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/letsencrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letsencrypt/subscriptions","organizations_url":"https://api.github.com/users/letsencrypt/orgs","repos_url":"https://api.github.com/users/letsencrypt/repos","events_url":"https://api.github.com/users/letsencrypt/events{/privacy}","received_events_url":"https://api.github.com/users/letsencrypt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/letsencrypt/boulder","description":"An ACME-based CA, written in Go.","fork":false,"url":"https://api.github.com/repos/letsencrypt/boulder","forks_url":"https://api.github.com/repos/letsencrypt/boulder/forks","keys_url":"https://api.github.com/repos/letsencrypt/boulder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/letsencrypt/boulder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/letsencrypt/boulder/teams","hooks_url":"https://api.github.com/repos/letsencrypt/boulder/hooks","issue_events_url":"https://api.github.com/repos/letsencrypt/boulder/issues/events{/number}","events_url":"https://api.github.com/repos/letsencrypt/boulder/events","assignees_url":"https://api.github.com/repos/letsencrypt/boulder/assignees{/user}","branches_url":"https://api.github.com/repos/letsencrypt/boulder/branches{/branch}","tags_url":"https://api.github.com/repos/letsencrypt/boulder/tags","blobs_url":"https://api.github.com/repos/letsencrypt/boulder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/letsencrypt/boulder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/letsencrypt/boulder/git/refs{/sha}","trees_url":"https://api.github.com/repos/letsencrypt/boulder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/letsencrypt/boulder/statuses/{sha}","languages_url":"https://api.github.com/repos/letsencrypt/boulder/languages","stargazers_url":"https://api.github.com/repos/letsencrypt/boulder/stargazers","contributors_url":"https://api.github.com/repos/letsencrypt/boulder/contributors","subscribers_url":"https://api.github.com/repos/letsencrypt/boulder/subscribers","subscription_url":"https://api.github.com/repos/letsencrypt/boulder/subscription","commits_url":"https://api.github.com/repos/letsencrypt/boulder/commits{/sha}","git_commits_url":"https://api.github.com/repos/letsencrypt/boulder/git/commits{/sha}","comments_url":"https://api.github.com/repos/letsencrypt/boulder/comments{/number}","issue_comment_url":"https://api.github.com/repos/letsencrypt/boulder/issues/comments{/number}","contents_url":"https://api.github.com/repos/letsencrypt/boulder/contents/{+path}","compare_url":"https://api.github.com/repos/letsencrypt/boulder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/letsencrypt/boulder/merges","archive_url":"https://api.github.com/repos/letsencrypt/boulder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/letsencrypt/boulder/downloads","issues_url":"https://api.github.com/repos/letsencrypt/boulder/issues{/number}","pulls_url":"https://api.github.com/repos/letsencrypt/boulder/pulls{/number}","milestones_url":"https://api.github.com/repos/letsencrypt/boulder/milestones{/number}","notifications_url":"https://api.github.com/repos/letsencrypt/boulder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/letsencrypt/boulder/labels{/name}","releases_url":"https://api.github.com/repos/letsencrypt/boulder/releases{/id}","deployments_url":"https://api.github.com/repos/letsencrypt/boulder/deployments","created_at":"2014-12-21T00:29:54Z","updated_at":"2016-06-10T19:38:44Z","pushed_at":"2016-06-10T19:53:50Z","git_url":"git://github.com/letsencrypt/boulder.git","ssh_url":"git@github.com:letsencrypt/boulder.git","clone_url":"https://github.com/letsencrypt/boulder.git","svn_url":"https://github.com/letsencrypt/boulder","homepage":null,"size":21861,"stargazers_count":1238,"watchers_count":1238,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":153,"mirror_url":null,"open_issues_count":186,"forks":153,"open_issues":186,"watchers":1238,"default_branch":"master"}},"base":{"label":"letsencrypt:master","ref":"master","sha":"d0e3883acb77f3335f809f559356b3af14c1d3ef","user":{"login":"letsencrypt","id":9289019,"avatar_url":"https://avatars.githubusercontent.com/u/9289019?v=3","gravatar_id":"","url":"https://api.github.com/users/letsencrypt","html_url":"https://github.com/letsencrypt","followers_url":"https://api.github.com/users/letsencrypt/followers","following_url":"https://api.github.com/users/letsencrypt/following{/other_user}","gists_url":"https://api.github.com/users/letsencrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/letsencrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letsencrypt/subscriptions","organizations_url":"https://api.github.com/users/letsencrypt/orgs","repos_url":"https://api.github.com/users/letsencrypt/repos","events_url":"https://api.github.com/users/letsencrypt/events{/privacy}","received_events_url":"https://api.github.com/users/letsencrypt/received_events","type":"Organization","site_admin":false},"repo":{"id":28283593,"name":"boulder","full_name":"letsencrypt/boulder","owner":{"login":"letsencrypt","id":9289019,"avatar_url":"https://avatars.githubusercontent.com/u/9289019?v=3","gravatar_id":"","url":"https://api.github.com/users/letsencrypt","html_url":"https://github.com/letsencrypt","followers_url":"https://api.github.com/users/letsencrypt/followers","following_url":"https://api.github.com/users/letsencrypt/following{/other_user}","gists_url":"https://api.github.com/users/letsencrypt/gists{/gist_id}","starred_url":"https://api.github.com/users/letsencrypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letsencrypt/subscriptions","organizations_url":"https://api.github.com/users/letsencrypt/orgs","repos_url":"https://api.github.com/users/letsencrypt/repos","events_url":"https://api.github.com/users/letsencrypt/events{/privacy}","received_events_url":"https://api.github.com/users/letsencrypt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/letsencrypt/boulder","description":"An ACME-based CA, written in Go.","fork":false,"url":"https://api.github.com/repos/letsencrypt/boulder","forks_url":"https://api.github.com/repos/letsencrypt/boulder/forks","keys_url":"https://api.github.com/repos/letsencrypt/boulder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/letsencrypt/boulder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/letsencrypt/boulder/teams","hooks_url":"https://api.github.com/repos/letsencrypt/boulder/hooks","issue_events_url":"https://api.github.com/repos/letsencrypt/boulder/issues/events{/number}","events_url":"https://api.github.com/repos/letsencrypt/boulder/events","assignees_url":"https://api.github.com/repos/letsencrypt/boulder/assignees{/user}","branches_url":"https://api.github.com/repos/letsencrypt/boulder/branches{/branch}","tags_url":"https://api.github.com/repos/letsencrypt/boulder/tags","blobs_url":"https://api.github.com/repos/letsencrypt/boulder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/letsencrypt/boulder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/letsencrypt/boulder/git/refs{/sha}","trees_url":"https://api.github.com/repos/letsencrypt/boulder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/letsencrypt/boulder/statuses/{sha}","languages_url":"https://api.github.com/repos/letsencrypt/boulder/languages","stargazers_url":"https://api.github.com/repos/letsencrypt/boulder/stargazers","contributors_url":"https://api.github.com/repos/letsencrypt/boulder/contributors","subscribers_url":"https://api.github.com/repos/letsencrypt/boulder/subscribers","subscription_url":"https://api.github.com/repos/letsencrypt/boulder/subscription","commits_url":"https://api.github.com/repos/letsencrypt/boulder/commits{/sha}","git_commits_url":"https://api.github.com/repos/letsencrypt/boulder/git/commits{/sha}","comments_url":"https://api.github.com/repos/letsencrypt/boulder/comments{/number}","issue_comment_url":"https://api.github.com/repos/letsencrypt/boulder/issues/comments{/number}","contents_url":"https://api.github.com/repos/letsencrypt/boulder/contents/{+path}","compare_url":"https://api.github.com/repos/letsencrypt/boulder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/letsencrypt/boulder/merges","archive_url":"https://api.github.com/repos/letsencrypt/boulder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/letsencrypt/boulder/downloads","issues_url":"https://api.github.com/repos/letsencrypt/boulder/issues{/number}","pulls_url":"https://api.github.com/repos/letsencrypt/boulder/pulls{/number}","milestones_url":"https://api.github.com/repos/letsencrypt/boulder/milestones{/number}","notifications_url":"https://api.github.com/repos/letsencrypt/boulder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/letsencrypt/boulder/labels{/name}","releases_url":"https://api.github.com/repos/letsencrypt/boulder/releases{/id}","deployments_url":"https://api.github.com/repos/letsencrypt/boulder/deployments","created_at":"2014-12-21T00:29:54Z","updated_at":"2016-06-10T19:38:44Z","pushed_at":"2016-06-10T19:53:50Z","git_url":"git://github.com/letsencrypt/boulder.git","ssh_url":"git@github.com:letsencrypt/boulder.git","clone_url":"https://github.com/letsencrypt/boulder.git","svn_url":"https://github.com/letsencrypt/boulder","homepage":null,"size":21861,"stargazers_count":1238,"watchers_count":1238,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":153,"mirror_url":null,"open_issues_count":186,"forks":153,"open_issues":186,"watchers":1238,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/letsencrypt/boulder/pulls/1918"},"html":{"href":"https://github.com/letsencrypt/boulder/pull/1918"},"issue":{"href":"https://api.github.com/repos/letsencrypt/boulder/issues/1918"},"comments":{"href":"https://api.github.com/repos/letsencrypt/boulder/issues/1918/comments"},"review_comments":{"href":"https://api.github.com/repos/letsencrypt/boulder/pulls/1918/comments"},"review_comment":{"href":"https://api.github.com/repos/letsencrypt/boulder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/letsencrypt/boulder/pulls/1918/commits"},"statuses":{"href":"https://api.github.com/repos/letsencrypt/boulder/statuses/a6278c1edef7d216c0f9923f2bd314441a1a3df2"}}}}
{"actor":{"display_login":"jsha"}}