From 56d263573364916e1d2a5d4758b54367c3b6dfaf Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 21 Jan 2021 10:55:16 +0100 Subject: [PATCH] Override ALPN methods on ReferenceCountedOpenSslEngine (#10954) Motivation: We should override the get*ApplicationProtocol() methods in ReferenceCountedOpenSslEngine to make it easier for users to obtain the selected application protocol Modifications: Add missing overrides Result: Easier for the user to get the selected application protocol (if any) --- .../handler/ssl/ReferenceCountedOpenSslEngine.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java index a4136c7ea0..f7fc36d020 100644 --- a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java +++ b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java @@ -473,6 +473,18 @@ public class ReferenceCountedOpenSslEngine extends SSLEngine implements Referenc return refCnt.release(decrement); } + // These method will override the method defined by Java 8u251 and later. As we may compile with an earlier + // java8 version we don't use @Override annotations here. + public String getApplicationProtocol() { + return applicationProtocol; + } + + // These method will override the method defined by Java 8u251 and later. As we may compile with an earlier + // java8 version we don't use @Override annotations here. + public String getHandshakeApplicationProtocol() { + return applicationProtocol; + } + @Override public final synchronized SSLSession getHandshakeSession() { // Javadocs state return value should be: