{"action":"created","comment":{"url":"https://api.github.com/repos/netty/netty/pulls/comments/29775131","id":29775131,"diff_hunk":"@@ -40,94 +34,24 @@\n import io.netty.handler.ssl.util.InsecureTrustManagerFactory;\n import io.netty.handler.ssl.util.SelfSignedCertificate;\n import io.netty.util.NetUtil;\n-import io.netty.util.concurrent.Future;\n \n-import java.io.File;\n import java.net.InetSocketAddress;\n import java.security.cert.CertificateException;\n import java.util.List;\n import java.util.Set;\n-import java.util.concurrent.CountDownLatch;\n import java.util.concurrent.TimeUnit;\n \n import javax.net.ssl.SSLEngine;\n import javax.net.ssl.SSLException;\n import javax.net.ssl.SSLHandshakeException;\n \n-import org.junit.After;\n-import org.junit.Before;\n import org.junit.Test;\n-import org.mockito.ArgumentCaptor;\n-import org.mockito.Mock;\n-import org.mockito.MockitoAnnotations;\n \n-public class JdkSslEngineTest {\n+public class JdkSslEngineTest extends SSLEngineTest {\n     private static final String PREFERRED_APPLICATION_LEVEL_PROTOCOL = \"my-protocol-http2\";\n     private static final String FALLBACK_APPLICATION_LEVEL_PROTOCOL = \"my-protocol-http1_1\";\n     private static final String APPLICATION_LEVEL_PROTOCOL_NOT_COMPATIBLE = \"my-protocol-FOO\";\n \n-    @Mock\n-    private MessageReciever serverReceiver;\n-    @Mock\n-    private MessageReciever clientReceiver;\n-\n-    private Throwable serverException;\n-    private Throwable clientException;\n-    private SslContext serverSslCtx;\n-    private SslContext clientSslCtx;\n-    private ServerBootstrap sb;\n-    private Bootstrap cb;\n-    private Channel serverChannel;\n-    private Channel serverConnectedChannel;\n-    private Channel clientChannel;\n-    private CountDownLatch serverLatch;\n-    private CountDownLatch clientLatch;\n-\n-    private interface MessageReciever {\n-        void messageReceived(ByteBuf msg);\n-    }\n-\n-    private final class MessageDelegatorChannelHandler extends SimpleChannelInboundHandler<ByteBuf> {\n-        private final MessageReciever receiver;\n-        private final CountDownLatch latch;\n-\n-        public MessageDelegatorChannelHandler(MessageReciever receiver, CountDownLatch latch) {\n-            super(false);\n-            this.receiver = receiver;\n-            this.latch = latch;\n-        }\n-\n-        @Override\n-        protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {\n-            receiver.messageReceived(msg);\n-            latch.countDown();\n-        }\n-    }\n-\n-    @Before\n-    public void setup() {\n-        MockitoAnnotations.initMocks(this);\n-        serverLatch = new CountDownLatch(1);\n-        clientLatch = new CountDownLatch(1);\n-    }\n-\n-    @After\n-    public void tearDown() throws InterruptedException {\n-        if (serverChannel != null) {\n-            serverChannel.close().sync();\n-            Future<?> serverGroup = sb.group().shutdownGracefully(0, 0, TimeUnit.MILLISECONDS);\n-            Future<?> serverChildGroup = sb.childGroup().shutdownGracefully(0, 0, TimeUnit.MILLISECONDS);\n-            Future<?> clientGroup = cb.group().shutdownGracefully(0, 0, TimeUnit.MILLISECONDS);\n-            serverGroup.sync();\n-            serverChildGroup.sync();\n-            clientGroup.sync();\n-        }\n-        clientChannel = null;\n-        serverChannel = null;\n-        serverConnectedChannel = null;\n-        serverException = null;\n-    }\n-\n     @Test\n     public void testNpn() throws Exception {","path":"handler/src/test/java/io/netty/handler/ssl/JdkSslEngineTest.java","position":118,"original_position":118,"commit_id":"a2f893f19639b6122c948ac1ca7c83b04836e972","original_commit_id":"a2f893f19639b6122c948ac1ca7c83b04836e972","user":{"login":"Scottmitch","id":7562868,"avatar_url":"https://avatars.githubusercontent.com/u/7562868?v=3","gravatar_id":"","url":"https://api.github.com/users/Scottmitch","html_url":"https://github.com/Scottmitch","followers_url":"https://api.github.com/users/Scottmitch/followers","following_url":"https://api.github.com/users/Scottmitch/following{/other_user}","gists_url":"https://api.github.com/users/Scottmitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Scottmitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scottmitch/subscriptions","organizations_url":"https://api.github.com/users/Scottmitch/orgs","repos_url":"https://api.github.com/users/Scottmitch/repos","events_url":"https://api.github.com/users/Scottmitch/events{/privacy}","received_events_url":"https://api.github.com/users/Scottmitch/received_events","type":"User","site_admin":false},"body":"Thanks! SGTM!","created_at":"2015-05-06T16:24:03Z","updated_at":"2015-05-06T16:24:03Z","html_url":"https://github.com/netty/netty/pull/3732#discussion_r29775131","pull_request_url":"https://api.github.com/repos/netty/netty/pulls/3732","_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/comments/29775131"},"html":{"href":"https://github.com/netty/netty/pull/3732#discussion_r29775131"},"pull_request":{"href":"https://api.github.com/repos/netty/netty/pulls/3732"}}},"pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/3732","id":34763550,"html_url":"https://github.com/netty/netty/pull/3732","diff_url":"https://github.com/netty/netty/pull/3732.diff","patch_url":"https://github.com/netty/netty/pull/3732.patch","issue_url":"https://api.github.com/repos/netty/netty/issues/3732","number":3732,"state":"closed","locked":false,"title":"Add support for mutual auth when using OpenSslEngine.","user":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"body":"Motivation:\r\n\r\nCurrently mutual auth is not supported when using OpenSslEngine.\r\n\r\nModification:\r\n\r\n- Add support to OpenSslClientContext\r\n- Correctly throw SSLHandshakeException when an error during handshake is detected\r\n\r\nResult:\r\n\r\nMutual auth can be used with OpenSslEngine","created_at":"2015-05-05T20:29:03Z","updated_at":"2015-05-06T16:24:03Z","closed_at":"2015-05-06T07:15:01Z","merged_at":null,"merge_commit_sha":"c00586edcd965db677fdcfacb094fb410040726e","assignee":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/netty/netty/milestones/115","html_url":"https://github.com/netty/netty/milestones/4.0.28.Final","labels_url":"https://api.github.com/repos/netty/netty/milestones/115/labels","id":1050260,"number":115,"title":"4.0.28.Final","description":"","creator":{"login":"normanmaurer","id":439362,"avatar_url":"https://avatars.githubusercontent.com/u/439362?v=3","gravatar_id":"","url":"https://api.github.com/users/normanmaurer","html_url":"https://github.com/normanmaurer","followers_url":"https://api.github.com/users/normanmaurer/followers","following_url":"https://api.github.com/users/normanmaurer/following{/other_user}","gists_url":"https://api.github.com/users/normanmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/normanmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanmaurer/subscriptions","organizations_url":"https://api.github.com/users/normanmaurer/orgs","repos_url":"https://api.github.com/users/normanmaurer/repos","events_url":"https://api.github.com/users/normanmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/normanmaurer/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":55,"state":"open","created_at":"2015-04-02T12:45:12Z","updated_at":"2015-05-06T15:47:27Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/netty/netty/pulls/3732/commits","review_comments_url":"https://api.github.com/repos/netty/netty/pulls/3732/comments","review_comment_url":"https://api.github.com/repos/netty/netty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/netty/netty/issues/3732/comments","statuses_url":"https://api.github.com/repos/netty/netty/statuses/a2f893f19639b6122c948ac1ca7c83b04836e972","head":{"label":"netty:openssl_mutual","ref":"openssl_mutual","sha":"a2f893f19639b6122c948ac1ca7c83b04836e972","user":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"repo":{"id":1064563,"name":"netty","full_name":"netty/netty","owner":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/netty/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":false,"url":"https://api.github.com/repos/netty/netty","forks_url":"https://api.github.com/repos/netty/netty/forks","keys_url":"https://api.github.com/repos/netty/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netty/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netty/netty/teams","hooks_url":"https://api.github.com/repos/netty/netty/hooks","issue_events_url":"https://api.github.com/repos/netty/netty/issues/events{/number}","events_url":"https://api.github.com/repos/netty/netty/events","assignees_url":"https://api.github.com/repos/netty/netty/assignees{/user}","branches_url":"https://api.github.com/repos/netty/netty/branches{/branch}","tags_url":"https://api.github.com/repos/netty/netty/tags","blobs_url":"https://api.github.com/repos/netty/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netty/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netty/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/netty/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netty/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/netty/netty/languages","stargazers_url":"https://api.github.com/repos/netty/netty/stargazers","contributors_url":"https://api.github.com/repos/netty/netty/contributors","subscribers_url":"https://api.github.com/repos/netty/netty/subscribers","subscription_url":"https://api.github.com/repos/netty/netty/subscription","commits_url":"https://api.github.com/repos/netty/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/netty/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/netty/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/netty/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/netty/netty/contents/{+path}","compare_url":"https://api.github.com/repos/netty/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netty/netty/merges","archive_url":"https://api.github.com/repos/netty/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netty/netty/downloads","issues_url":"https://api.github.com/repos/netty/netty/issues{/number}","pulls_url":"https://api.github.com/repos/netty/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/netty/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/netty/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netty/netty/labels{/name}","releases_url":"https://api.github.com/repos/netty/netty/releases{/id}","created_at":"2010-11-09T09:22:21Z","updated_at":"2015-05-06T15:57:29Z","pushed_at":"2015-05-06T16:05:30Z","git_url":"git://github.com/netty/netty.git","ssh_url":"git@github.com:netty/netty.git","clone_url":"https://github.com/netty/netty.git","svn_url":"https://github.com/netty/netty","homepage":"http://netty.io/","size":121276,"stargazers_count":4554,"watchers_count":4554,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2234,"mirror_url":null,"open_issues_count":261,"forks":2234,"open_issues":261,"watchers":4554,"default_branch":"master"}},"base":{"label":"netty:4.0","ref":"4.0","sha":"59209f16bfd736f3d1dc8e7da68cb50a5d74c24f","user":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"repo":{"id":1064563,"name":"netty","full_name":"netty/netty","owner":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/netty/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":false,"url":"https://api.github.com/repos/netty/netty","forks_url":"https://api.github.com/repos/netty/netty/forks","keys_url":"https://api.github.com/repos/netty/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netty/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netty/netty/teams","hooks_url":"https://api.github.com/repos/netty/netty/hooks","issue_events_url":"https://api.github.com/repos/netty/netty/issues/events{/number}","events_url":"https://api.github.com/repos/netty/netty/events","assignees_url":"https://api.github.com/repos/netty/netty/assignees{/user}","branches_url":"https://api.github.com/repos/netty/netty/branches{/branch}","tags_url":"https://api.github.com/repos/netty/netty/tags","blobs_url":"https://api.github.com/repos/netty/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netty/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netty/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/netty/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netty/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/netty/netty/languages","stargazers_url":"https://api.github.com/repos/netty/netty/stargazers","contributors_url":"https://api.github.com/repos/netty/netty/contributors","subscribers_url":"https://api.github.com/repos/netty/netty/subscribers","subscription_url":"https://api.github.com/repos/netty/netty/subscription","commits_url":"https://api.github.com/repos/netty/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/netty/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/netty/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/netty/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/netty/netty/contents/{+path}","compare_url":"https://api.github.com/repos/netty/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netty/netty/merges","archive_url":"https://api.github.com/repos/netty/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netty/netty/downloads","issues_url":"https://api.github.com/repos/netty/netty/issues{/number}","pulls_url":"https://api.github.com/repos/netty/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/netty/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/netty/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netty/netty/labels{/name}","releases_url":"https://api.github.com/repos/netty/netty/releases{/id}","created_at":"2010-11-09T09:22:21Z","updated_at":"2015-05-06T15:57:29Z","pushed_at":"2015-05-06T16:05:30Z","git_url":"git://github.com/netty/netty.git","ssh_url":"git@github.com:netty/netty.git","clone_url":"https://github.com/netty/netty.git","svn_url":"https://github.com/netty/netty","homepage":"http://netty.io/","size":121276,"stargazers_count":4554,"watchers_count":4554,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2234,"mirror_url":null,"open_issues_count":261,"forks":2234,"open_issues":261,"watchers":4554,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/3732"},"html":{"href":"https://github.com/netty/netty/pull/3732"},"issue":{"href":"https://api.github.com/repos/netty/netty/issues/3732"},"comments":{"href":"https://api.github.com/repos/netty/netty/issues/3732/comments"},"review_comments":{"href":"https://api.github.com/repos/netty/netty/pulls/3732/comments"},"review_comment":{"href":"https://api.github.com/repos/netty/netty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/netty/netty/pulls/3732/commits"},"statuses":{"href":"https://api.github.com/repos/netty/netty/statuses/a2f893f19639b6122c948ac1ca7c83b04836e972"}}}}