{"action":"created","comment":{"url":"https://api.github.com/repos/vespa-engine/vespa/pulls/comments/214699829","pull_request_review_id":151807832,"id":214699829,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDY5OTgyOQ==","diff_hunk":"@@ -0,0 +1,232 @@\n+// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.\n+package com.yahoo.jrt;\n+\n+import javax.net.ssl.SSLEngine;\n+import javax.net.ssl.SSLEngineResult;\n+import javax.net.ssl.SSLException;\n+import javax.net.ssl.SSLSession;\n+import java.io.IOException;\n+import java.nio.ByteBuffer;\n+import java.nio.channels.ClosedChannelException;\n+import java.nio.channels.SocketChannel;\n+import java.util.logging.Logger;\n+\n+import static javax.net.ssl.SSLEngineResult.*;\n+\n+/**\n+ * A {@link CryptoSocket} using TLS ({@link SSLEngine})\n+ *\n+ * @author bjorncs\n+ */\n+public class SslSocket implements CryptoSocket {\n+\n+    private static final Logger log = Logger.getLogger(SslSocket.class.getName());\n+\n+    private enum HandshakeState { NOT_STARTED, NEED_READ, NEED_WRITE, COMPLETED }\n+\n+    private final SocketChannel channel;\n+    private final SSLEngine sslEngine;\n+    private final ByteBuffer wrapBuffer;\n+    private final ByteBuffer unwrapBuffer;\n+    private final ByteBuffer handshakeDummyBuffer;","path":"jrt/src/com/yahoo/jrt/SslSocket.java","position":31,"original_position":31,"commit_id":"418c52b59b1ac2f3a188f5de174b1f3497dc78c5","original_commit_id":"418c52b59b1ac2f3a188f5de174b1f3497dc78c5","user":{"login":"havardpe","id":3535158,"node_id":"MDQ6VXNlcjM1MzUxNTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3535158?v=4","gravatar_id":"","url":"https://api.github.com/users/havardpe","html_url":"https://github.com/havardpe","followers_url":"https://api.github.com/users/havardpe/followers","following_url":"https://api.github.com/users/havardpe/following{/other_user}","gists_url":"https://api.github.com/users/havardpe/gists{/gist_id}","starred_url":"https://api.github.com/users/havardpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/havardpe/subscriptions","organizations_url":"https://api.github.com/users/havardpe/orgs","repos_url":"https://api.github.com/users/havardpe/repos","events_url":"https://api.github.com/users/havardpe/events{/privacy}","received_events_url":"https://api.github.com/users/havardpe/received_events","type":"User","site_admin":false},"body":"consider discarding this after handshake has completed","created_at":"2018-09-03T14:04:54Z","updated_at":"2018-09-03T14:35:43Z","html_url":"https://github.com/vespa-engine/vespa/pull/6770#discussion_r214699829","pull_request_url":"https://api.github.com/repos/vespa-engine/vespa/pulls/6770","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/comments/214699829"},"html":{"href":"https://github.com/vespa-engine/vespa/pull/6770#discussion_r214699829"},"pull_request":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/6770"}}},"pull_request":{"url":"https://api.github.com/repos/vespa-engine/vespa/pulls/6770","id":212751427,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNzUxNDI3","html_url":"https://github.com/vespa-engine/vespa/pull/6770","diff_url":"https://github.com/vespa-engine/vespa/pull/6770.diff","patch_url":"https://github.com/vespa-engine/vespa/pull/6770.patch","issue_url":"https://api.github.com/repos/vespa-engine/vespa/issues/6770","number":6770,"state":"open","locked":false,"title":"Bjorncs/jrt ssl socket","user":{"login":"bjorncs","id":798335,"node_id":"MDQ6VXNlcjc5ODMzNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/798335?v=4","gravatar_id":"","url":"https://api.github.com/users/bjorncs","html_url":"https://github.com/bjorncs","followers_url":"https://api.github.com/users/bjorncs/followers","following_url":"https://api.github.com/users/bjorncs/following{/other_user}","gists_url":"https://api.github.com/users/bjorncs/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorncs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorncs/subscriptions","organizations_url":"https://api.github.com/users/bjorncs/orgs","repos_url":"https://api.github.com/users/bjorncs/repos","events_url":"https://api.github.com/users/bjorncs/events{/privacy}","received_events_url":"https://api.github.com/users/bjorncs/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-03T13:36:01Z","updated_at":"2018-09-03T14:35:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfc095e87340542ca0558feec934837ecd7af7ab","assignee":null,"assignees":[],"requested_reviewers":[{"login":"vekterli","id":16582643,"node_id":"MDQ6VXNlcjE2NTgyNjQz","avatar_url":"https://avatars1.githubusercontent.com/u/16582643?v=4","gravatar_id":"","url":"https://api.github.com/users/vekterli","html_url":"https://github.com/vekterli","followers_url":"https://api.github.com/users/vekterli/followers","following_url":"https://api.github.com/users/vekterli/following{/other_user}","gists_url":"https://api.github.com/users/vekterli/gists{/gist_id}","starred_url":"https://api.github.com/users/vekterli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vekterli/subscriptions","organizations_url":"https://api.github.com/users/vekterli/orgs","repos_url":"https://api.github.com/users/vekterli/repos","events_url":"https://api.github.com/users/vekterli/events{/privacy}","received_events_url":"https://api.github.com/users/vekterli/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vespa-engine/vespa/pulls/6770/commits","review_comments_url":"https://api.github.com/repos/vespa-engine/vespa/pulls/6770/comments","review_comment_url":"https://api.github.com/repos/vespa-engine/vespa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vespa-engine/vespa/issues/6770/comments","statuses_url":"https://api.github.com/repos/vespa-engine/vespa/statuses/418c52b59b1ac2f3a188f5de174b1f3497dc78c5","head":{"label":"vespa-engine:bjorncs/jrt-ssl-socket","ref":"bjorncs/jrt-ssl-socket","sha":"418c52b59b1ac2f3a188f5de174b1f3497dc78c5","user":{"login":"vespa-engine","id":29299694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mjk5Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/29299694?v=4","gravatar_id":"","url":"https://api.github.com/users/vespa-engine","html_url":"https://github.com/vespa-engine","followers_url":"https://api.github.com/users/vespa-engine/followers","following_url":"https://api.github.com/users/vespa-engine/following{/other_user}","gists_url":"https://api.github.com/users/vespa-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/vespa-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vespa-engine/subscriptions","organizations_url":"https://api.github.com/users/vespa-engine/orgs","repos_url":"https://api.github.com/users/vespa-engine/repos","events_url":"https://api.github.com/users/vespa-engine/events{/privacy}","received_events_url":"https://api.github.com/users/vespa-engine/received_events","type":"Organization","site_admin":false},"repo":{"id":60377070,"node_id":"MDEwOlJlcG9zaXRvcnk2MDM3NzA3MA==","name":"vespa","full_name":"vespa-engine/vespa","owner":{"login":"vespa-engine","id":29299694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mjk5Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/29299694?v=4","gravatar_id":"","url":"https://api.github.com/users/vespa-engine","html_url":"https://github.com/vespa-engine","followers_url":"https://api.github.com/users/vespa-engine/followers","following_url":"https://api.github.com/users/vespa-engine/following{/other_user}","gists_url":"https://api.github.com/users/vespa-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/vespa-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vespa-engine/subscriptions","organizations_url":"https://api.github.com/users/vespa-engine/orgs","repos_url":"https://api.github.com/users/vespa-engine/repos","events_url":"https://api.github.com/users/vespa-engine/events{/privacy}","received_events_url":"https://api.github.com/users/vespa-engine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vespa-engine/vespa","description":"Vespa - the open big data serving engine","fork":false,"url":"https://api.github.com/repos/vespa-engine/vespa","forks_url":"https://api.github.com/repos/vespa-engine/vespa/forks","keys_url":"https://api.github.com/repos/vespa-engine/vespa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vespa-engine/vespa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vespa-engine/vespa/teams","hooks_url":"https://api.github.com/repos/vespa-engine/vespa/hooks","issue_events_url":"https://api.github.com/repos/vespa-engine/vespa/issues/events{/number}","events_url":"https://api.github.com/repos/vespa-engine/vespa/events","assignees_url":"https://api.github.com/repos/vespa-engine/vespa/assignees{/user}","branches_url":"https://api.github.com/repos/vespa-engine/vespa/branches{/branch}","tags_url":"https://api.github.com/repos/vespa-engine/vespa/tags","blobs_url":"https://api.github.com/repos/vespa-engine/vespa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vespa-engine/vespa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vespa-engine/vespa/git/refs{/sha}","trees_url":"https://api.github.com/repos/vespa-engine/vespa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vespa-engine/vespa/statuses/{sha}","languages_url":"https://api.github.com/repos/vespa-engine/vespa/languages","stargazers_url":"https://api.github.com/repos/vespa-engine/vespa/stargazers","contributors_url":"https://api.github.com/repos/vespa-engine/vespa/contributors","subscribers_url":"https://api.github.com/repos/vespa-engine/vespa/subscribers","subscription_url":"https://api.github.com/repos/vespa-engine/vespa/subscription","commits_url":"https://api.github.com/repos/vespa-engine/vespa/commits{/sha}","git_commits_url":"https://api.github.com/repos/vespa-engine/vespa/git/commits{/sha}","comments_url":"https://api.github.com/repos/vespa-engine/vespa/comments{/number}","issue_comment_url":"https://api.github.com/repos/vespa-engine/vespa/issues/comments{/number}","contents_url":"https://api.github.com/repos/vespa-engine/vespa/contents/{+path}","compare_url":"https://api.github.com/repos/vespa-engine/vespa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vespa-engine/vespa/merges","archive_url":"https://api.github.com/repos/vespa-engine/vespa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vespa-engine/vespa/downloads","issues_url":"https://api.github.com/repos/vespa-engine/vespa/issues{/number}","pulls_url":"https://api.github.com/repos/vespa-engine/vespa/pulls{/number}","milestones_url":"https://api.github.com/repos/vespa-engine/vespa/milestones{/number}","notifications_url":"https://api.github.com/repos/vespa-engine/vespa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vespa-engine/vespa/labels{/name}","releases_url":"https://api.github.com/repos/vespa-engine/vespa/releases{/id}","deployments_url":"https://api.github.com/repos/vespa-engine/vespa/deployments","created_at":"2016-06-03T20:54:20Z","updated_at":"2018-09-03T13:18:32Z","pushed_at":"2018-09-03T14:19:45Z","git_url":"git://github.com/vespa-engine/vespa.git","ssh_url":"git@github.com:vespa-engine/vespa.git","clone_url":"https://github.com/vespa-engine/vespa.git","svn_url":"https://github.com/vespa-engine/vespa","homepage":"http://vespa.ai/","size":74643,"stargazers_count":2567,"watchers_count":2567,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":303,"mirror_url":null,"archived":false,"open_issues_count":54,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":303,"open_issues":54,"watchers":2567,"default_branch":"master"}},"base":{"label":"vespa-engine:master","ref":"master","sha":"ae594f2b7453ff1c5109fd8a9cec9339ec0a6366","user":{"login":"vespa-engine","id":29299694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mjk5Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/29299694?v=4","gravatar_id":"","url":"https://api.github.com/users/vespa-engine","html_url":"https://github.com/vespa-engine","followers_url":"https://api.github.com/users/vespa-engine/followers","following_url":"https://api.github.com/users/vespa-engine/following{/other_user}","gists_url":"https://api.github.com/users/vespa-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/vespa-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vespa-engine/subscriptions","organizations_url":"https://api.github.com/users/vespa-engine/orgs","repos_url":"https://api.github.com/users/vespa-engine/repos","events_url":"https://api.github.com/users/vespa-engine/events{/privacy}","received_events_url":"https://api.github.com/users/vespa-engine/received_events","type":"Organization","site_admin":false},"repo":{"id":60377070,"node_id":"MDEwOlJlcG9zaXRvcnk2MDM3NzA3MA==","name":"vespa","full_name":"vespa-engine/vespa","owner":{"login":"vespa-engine","id":29299694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5Mjk5Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/29299694?v=4","gravatar_id":"","url":"https://api.github.com/users/vespa-engine","html_url":"https://github.com/vespa-engine","followers_url":"https://api.github.com/users/vespa-engine/followers","following_url":"https://api.github.com/users/vespa-engine/following{/other_user}","gists_url":"https://api.github.com/users/vespa-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/vespa-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vespa-engine/subscriptions","organizations_url":"https://api.github.com/users/vespa-engine/orgs","repos_url":"https://api.github.com/users/vespa-engine/repos","events_url":"https://api.github.com/users/vespa-engine/events{/privacy}","received_events_url":"https://api.github.com/users/vespa-engine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vespa-engine/vespa","description":"Vespa - the open big data serving engine","fork":false,"url":"https://api.github.com/repos/vespa-engine/vespa","forks_url":"https://api.github.com/repos/vespa-engine/vespa/forks","keys_url":"https://api.github.com/repos/vespa-engine/vespa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vespa-engine/vespa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vespa-engine/vespa/teams","hooks_url":"https://api.github.com/repos/vespa-engine/vespa/hooks","issue_events_url":"https://api.github.com/repos/vespa-engine/vespa/issues/events{/number}","events_url":"https://api.github.com/repos/vespa-engine/vespa/events","assignees_url":"https://api.github.com/repos/vespa-engine/vespa/assignees{/user}","branches_url":"https://api.github.com/repos/vespa-engine/vespa/branches{/branch}","tags_url":"https://api.github.com/repos/vespa-engine/vespa/tags","blobs_url":"https://api.github.com/repos/vespa-engine/vespa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vespa-engine/vespa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vespa-engine/vespa/git/refs{/sha}","trees_url":"https://api.github.com/repos/vespa-engine/vespa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vespa-engine/vespa/statuses/{sha}","languages_url":"https://api.github.com/repos/vespa-engine/vespa/languages","stargazers_url":"https://api.github.com/repos/vespa-engine/vespa/stargazers","contributors_url":"https://api.github.com/repos/vespa-engine/vespa/contributors","subscribers_url":"https://api.github.com/repos/vespa-engine/vespa/subscribers","subscription_url":"https://api.github.com/repos/vespa-engine/vespa/subscription","commits_url":"https://api.github.com/repos/vespa-engine/vespa/commits{/sha}","git_commits_url":"https://api.github.com/repos/vespa-engine/vespa/git/commits{/sha}","comments_url":"https://api.github.com/repos/vespa-engine/vespa/comments{/number}","issue_comment_url":"https://api.github.com/repos/vespa-engine/vespa/issues/comments{/number}","contents_url":"https://api.github.com/repos/vespa-engine/vespa/contents/{+path}","compare_url":"https://api.github.com/repos/vespa-engine/vespa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vespa-engine/vespa/merges","archive_url":"https://api.github.com/repos/vespa-engine/vespa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vespa-engine/vespa/downloads","issues_url":"https://api.github.com/repos/vespa-engine/vespa/issues{/number}","pulls_url":"https://api.github.com/repos/vespa-engine/vespa/pulls{/number}","milestones_url":"https://api.github.com/repos/vespa-engine/vespa/milestones{/number}","notifications_url":"https://api.github.com/repos/vespa-engine/vespa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vespa-engine/vespa/labels{/name}","releases_url":"https://api.github.com/repos/vespa-engine/vespa/releases{/id}","deployments_url":"https://api.github.com/repos/vespa-engine/vespa/deployments","created_at":"2016-06-03T20:54:20Z","updated_at":"2018-09-03T13:18:32Z","pushed_at":"2018-09-03T14:19:45Z","git_url":"git://github.com/vespa-engine/vespa.git","ssh_url":"git@github.com:vespa-engine/vespa.git","clone_url":"https://github.com/vespa-engine/vespa.git","svn_url":"https://github.com/vespa-engine/vespa","homepage":"http://vespa.ai/","size":74643,"stargazers_count":2567,"watchers_count":2567,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":303,"mirror_url":null,"archived":false,"open_issues_count":54,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":303,"open_issues":54,"watchers":2567,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/6770"},"html":{"href":"https://github.com/vespa-engine/vespa/pull/6770"},"issue":{"href":"https://api.github.com/repos/vespa-engine/vespa/issues/6770"},"comments":{"href":"https://api.github.com/repos/vespa-engine/vespa/issues/6770/comments"},"review_comments":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/6770/comments"},"review_comment":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vespa-engine/vespa/pulls/6770/commits"},"statuses":{"href":"https://api.github.com/repos/vespa-engine/vespa/statuses/418c52b59b1ac2f3a188f5de174b1f3497dc78c5"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"havardpe"}}