{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc-java/pulls/comments/35053179","id":35053179,"diff_hunk":"@@ -117,15 +118,30 @@ public OkHttpChannelBuilder transportExecutor(ExecutorService executor) {\n    * <p>Should only used by tests.\n    */\n   public OkHttpChannelBuilder overrideHostForAuthority(String host) {\n-    this.authorityHost = host;\n+    this.authorityHost = Preconditions.checkNotNull(host);\n+    return this;\n+  }\n+\n+  /**\n+   * Sets the negotiation type for the HTTP/2 connection.\n+   *\n+   * <p>Default: <code>TLS</code>\n+   */\n+  public OkHttpChannelBuilder negotiationType(NegotiationType type) {\n+    negotiationType = Preconditions.checkNotNull(type);\n     return this;\n   }\n \n   /**\n-   * Provides a SSLSocketFactory to establish a secure connection.\n+   * Provides a SSLSocketFactory to replace the default SSLSocketFactory used for TLS.\n+   *\n+   * <p>By default, when TLS is enabled, <code>SSLSocketFactory.getDefault()</code> will be used.\n+   *\n+   * <p><code>negotiationType(NegotiationType.TLS)</code> will be called inside this method.","path":"okhttp/src/main/java/io/grpc/transport/okhttp/OkHttpChannelBuilder.java","position":42,"original_position":42,"commit_id":"cab6d575c70a25fef70eae01a7cf0b218f1f10b3","original_commit_id":"cab6d575c70a25fef70eae01a7cf0b218f1f10b3","user":{"login":"ejona86","id":2811396,"avatar_url":"https://avatars.githubusercontent.com/u/2811396?v=3","gravatar_id":"","url":"https://api.github.com/users/ejona86","html_url":"https://github.com/ejona86","followers_url":"https://api.github.com/users/ejona86/followers","following_url":"https://api.github.com/users/ejona86/following{/other_user}","gists_url":"https://api.github.com/users/ejona86/gists{/gist_id}","starred_url":"https://api.github.com/users/ejona86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejona86/subscriptions","organizations_url":"https://api.github.com/users/ejona86/orgs","repos_url":"https://api.github.com/users/ejona86/repos","events_url":"https://api.github.com/users/ejona86/events{/privacy}","received_events_url":"https://api.github.com/users/ejona86/received_events","type":"User","site_admin":false},"body":"You say it will be called, but you explaining it from the user's stand point. How about:\r\n\r\n> The {@link #negotationType} will be set to {@link NegotiationType#TLS}.","created_at":"2015-07-20T22:46:03Z","updated_at":"2015-07-20T22:46:03Z","html_url":"https://github.com/grpc/grpc-java/pull/629#discussion_r35053179","pull_request_url":"https://api.github.com/repos/grpc/grpc-java/pulls/629","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/comments/35053179"},"html":{"href":"https://github.com/grpc/grpc-java/pull/629#discussion_r35053179"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/629"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc-java/pulls/629","id":40060785,"html_url":"https://github.com/grpc/grpc-java/pull/629","diff_url":"https://github.com/grpc/grpc-java/pull/629.diff","patch_url":"https://github.com/grpc/grpc-java/pull/629.patch","issue_url":"https://api.github.com/repos/grpc/grpc-java/issues/629","number":629,"state":"open","locked":false,"title":"okhttp: Enable TLS by default.","user":{"login":"madongfly","id":1962333,"avatar_url":"https://avatars.githubusercontent.com/u/1962333?v=3","gravatar_id":"","url":"https://api.github.com/users/madongfly","html_url":"https://github.com/madongfly","followers_url":"https://api.github.com/users/madongfly/followers","following_url":"https://api.github.com/users/madongfly/following{/other_user}","gists_url":"https://api.github.com/users/madongfly/gists{/gist_id}","starred_url":"https://api.github.com/users/madongfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madongfly/subscriptions","organizations_url":"https://api.github.com/users/madongfly/orgs","repos_url":"https://api.github.com/users/madongfly/repos","events_url":"https://api.github.com/users/madongfly/events{/privacy}","received_events_url":"https://api.github.com/users/madongfly/received_events","type":"User","site_admin":false},"body":"Use SSLSocketFactory.getDefault() for TLS by default.\r\n\r\n@ejona86, please take a look, thanks!","created_at":"2015-07-15T19:37:00Z","updated_at":"2015-07-20T22:46:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bace0bcb270282df22d7929869059e989642c37","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc-java/pulls/629/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc-java/pulls/629/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc-java/issues/629/comments","statuses_url":"https://api.github.com/repos/grpc/grpc-java/statuses/cab6d575c70a25fef70eae01a7cf0b218f1f10b3","head":{"label":"madongfly:tls","ref":"tls","sha":"cab6d575c70a25fef70eae01a7cf0b218f1f10b3","user":{"login":"madongfly","id":1962333,"avatar_url":"https://avatars.githubusercontent.com/u/1962333?v=3","gravatar_id":"","url":"https://api.github.com/users/madongfly","html_url":"https://github.com/madongfly","followers_url":"https://api.github.com/users/madongfly/followers","following_url":"https://api.github.com/users/madongfly/following{/other_user}","gists_url":"https://api.github.com/users/madongfly/gists{/gist_id}","starred_url":"https://api.github.com/users/madongfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madongfly/subscriptions","organizations_url":"https://api.github.com/users/madongfly/orgs","repos_url":"https://api.github.com/users/madongfly/repos","events_url":"https://api.github.com/users/madongfly/events{/privacy}","received_events_url":"https://api.github.com/users/madongfly/received_events","type":"User","site_admin":false},"repo":{"id":32011307,"name":"grpc-java","full_name":"madongfly/grpc-java","owner":{"login":"madongfly","id":1962333,"avatar_url":"https://avatars.githubusercontent.com/u/1962333?v=3","gravatar_id":"","url":"https://api.github.com/users/madongfly","html_url":"https://github.com/madongfly","followers_url":"https://api.github.com/users/madongfly/followers","following_url":"https://api.github.com/users/madongfly/following{/other_user}","gists_url":"https://api.github.com/users/madongfly/gists{/gist_id}","starred_url":"https://api.github.com/users/madongfly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madongfly/subscriptions","organizations_url":"https://api.github.com/users/madongfly/orgs","repos_url":"https://api.github.com/users/madongfly/repos","events_url":"https://api.github.com/users/madongfly/events{/privacy}","received_events_url":"https://api.github.com/users/madongfly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/madongfly/grpc-java","description":"The Java gRPC implementation. HTTP/2 based RPC","fork":true,"url":"https://api.github.com/repos/madongfly/grpc-java","forks_url":"https://api.github.com/repos/madongfly/grpc-java/forks","keys_url":"https://api.github.com/repos/madongfly/grpc-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/madongfly/grpc-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/madongfly/grpc-java/teams","hooks_url":"https://api.github.com/repos/madongfly/grpc-java/hooks","issue_events_url":"https://api.github.com/repos/madongfly/grpc-java/issues/events{/number}","events_url":"https://api.github.com/repos/madongfly/grpc-java/events","assignees_url":"https://api.github.com/repos/madongfly/grpc-java/assignees{/user}","branches_url":"https://api.github.com/repos/madongfly/grpc-java/branches{/branch}","tags_url":"https://api.github.com/repos/madongfly/grpc-java/tags","blobs_url":"https://api.github.com/repos/madongfly/grpc-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/madongfly/grpc-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/madongfly/grpc-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/madongfly/grpc-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/madongfly/grpc-java/statuses/{sha}","languages_url":"https://api.github.com/repos/madongfly/grpc-java/languages","stargazers_url":"https://api.github.com/repos/madongfly/grpc-java/stargazers","contributors_url":"https://api.github.com/repos/madongfly/grpc-java/contributors","subscribers_url":"https://api.github.com/repos/madongfly/grpc-java/subscribers","subscription_url":"https://api.github.com/repos/madongfly/grpc-java/subscription","commits_url":"https://api.github.com/repos/madongfly/grpc-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/madongfly/grpc-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/madongfly/grpc-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/madongfly/grpc-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/madongfly/grpc-java/contents/{+path}","compare_url":"https://api.github.com/repos/madongfly/grpc-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/madongfly/grpc-java/merges","archive_url":"https://api.github.com/repos/madongfly/grpc-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/madongfly/grpc-java/downloads","issues_url":"https://api.github.com/repos/madongfly/grpc-java/issues{/number}","pulls_url":"https://api.github.com/repos/madongfly/grpc-java/pulls{/number}","milestones_url":"https://api.github.com/repos/madongfly/grpc-java/milestones{/number}","notifications_url":"https://api.github.com/repos/madongfly/grpc-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/madongfly/grpc-java/labels{/name}","releases_url":"https://api.github.com/repos/madongfly/grpc-java/releases{/id}","created_at":"2015-03-11T10:19:21Z","updated_at":"2015-04-29T23:27:25Z","pushed_at":"2015-07-20T21:40:13Z","git_url":"git://github.com/madongfly/grpc-java.git","ssh_url":"git@github.com:madongfly/grpc-java.git","clone_url":"https://github.com/madongfly/grpc-java.git","svn_url":"https://github.com/madongfly/grpc-java","homepage":"","size":3263,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"grpc:master","ref":"master","sha":"79f3f026f2f95a0d262bba59d43befb0f6d080b6","user":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729926,"name":"grpc-java","full_name":"grpc/grpc-java","owner":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc-java","description":"The Java gRPC implementation. HTTP/2 based RPC","fork":false,"url":"https://api.github.com/repos/grpc/grpc-java","forks_url":"https://api.github.com/repos/grpc/grpc-java/forks","keys_url":"https://api.github.com/repos/grpc/grpc-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc-java/teams","hooks_url":"https://api.github.com/repos/grpc/grpc-java/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc-java/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc-java/events","assignees_url":"https://api.github.com/repos/grpc/grpc-java/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc-java/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc-java/tags","blobs_url":"https://api.github.com/repos/grpc/grpc-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc-java/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc-java/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc-java/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc-java/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc-java/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc-java/subscription","commits_url":"https://api.github.com/repos/grpc/grpc-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc-java/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc-java/merges","archive_url":"https://api.github.com/repos/grpc/grpc-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc-java/downloads","issues_url":"https://api.github.com/repos/grpc/grpc-java/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc-java/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc-java/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc-java/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc-java/releases{/id}","created_at":"2014-12-08T19:00:00Z","updated_at":"2015-07-20T15:00:18Z","pushed_at":"2015-07-20T21:40:13Z","git_url":"git://github.com/grpc/grpc-java.git","ssh_url":"git@github.com:grpc/grpc-java.git","clone_url":"https://github.com/grpc/grpc-java.git","svn_url":"https://github.com/grpc/grpc-java","homepage":"","size":19333,"stargazers_count":790,"watchers_count":790,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":178,"mirror_url":null,"open_issues_count":92,"forks":178,"open_issues":92,"watchers":790,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/629"},"html":{"href":"https://github.com/grpc/grpc-java/pull/629"},"issue":{"href":"https://api.github.com/repos/grpc/grpc-java/issues/629"},"comments":{"href":"https://api.github.com/repos/grpc/grpc-java/issues/629/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/629/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc-java/pulls/629/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc-java/statuses/cab6d575c70a25fef70eae01a7cf0b218f1f10b3"}}}}