{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty/issues/3883","labels_url":"https://api.github.com/repos/netty/netty/issues/3883/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/3883/comments","events_url":"https://api.github.com/repos/netty/netty/issues/3883/events","html_url":"https://github.com/netty/netty/issues/3883","id":87550343,"number":3883,"title":"OpenSSL SSLSession returns incorrect peer principal","user":{"login":"edwinchoi","id":773193,"avatar_url":"https://avatars.githubusercontent.com/u/773193?v=3","gravatar_id":"","url":"https://api.github.com/users/edwinchoi","html_url":"https://github.com/edwinchoi","followers_url":"https://api.github.com/users/edwinchoi/followers","following_url":"https://api.github.com/users/edwinchoi/following{/other_user}","gists_url":"https://api.github.com/users/edwinchoi/gists{/gist_id}","starred_url":"https://api.github.com/users/edwinchoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwinchoi/subscriptions","organizations_url":"https://api.github.com/users/edwinchoi/orgs","repos_url":"https://api.github.com/users/edwinchoi/repos","events_url":"https://api.github.com/users/edwinchoi/events{/privacy}","received_events_url":"https://api.github.com/users/edwinchoi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/netty/netty/labels/defect","name":"defect","color":"e11d21"}],"state":"open","locked":false,"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/116","html_url":"https://github.com/netty/netty/milestones/4.0.29.Final","labels_url":"https://api.github.com/repos/netty/netty/milestones/116/labels","id":1091077,"number":116,"title":"4.0.29.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":67,"closed_issues":50,"state":"open","created_at":"2015-04-30T13:26:30Z","updated_at":"2015-06-16T18:05:42Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-06-12T00:22:22Z","updated_at":"2015-06-16T18:06:19Z","closed_at":null,"body":"According to the docs for `javax.net.ssl.SSLSession` (http://docs.oracle.com/javase/7/docs/api/javax/net/ssl/SSLSession.html#getPeerPrincipal()), `getPeerPrincipal` should be returning the identity of the peer.\r\n\r\nThe OpenSSL based implementation for Netty, however, is returning the identity of the issuer:\r\nhttps://github.com/netty/netty/blob/netty-4.0.28.Final/handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java#L1406\r\n`getPeerPrincipal()` calls `principal(certs)`, which casts to `X509Certificate` and calls `getIssuerX500Principal()` when it should be calling `getSubject500Principal()`.\r\n\r\nThe JDK based implementation returns the correct principal."},"comment":{"url":"https://api.github.com/repos/netty/netty/issues/comments/112516442","html_url":"https://github.com/netty/netty/issues/3883#issuecomment-112516442","issue_url":"https://api.github.com/repos/netty/netty/issues/3883","id":112516442,"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},"created_at":"2015-06-16T18:06:19Z","updated_at":"2015-06-16T18:06:19Z","body":"@edwinchoi can you verify the fix:\r\n\r\nhttps://github.com/netty/netty/pull/3889\r\n\r\nThanks!"}}