Skip to content

Commit

Permalink
Issue #4443 - Track backport of ALPN APIs to Java 8.
Browse files Browse the repository at this point in the history
Improved logging after review.

Signed-off-by: Simone Bordet <[email protected]>
  • Loading branch information
sbordet committed Mar 18, 2020
1 parent 6df47dd commit 1be2f47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ public void init()
// Use reflection so we can build with a JDK version less than 8u252.
alpnProtocols = SSLParameters.class.getMethod("setApplicationProtocols", String[].class);
alpnProtocol = SSLEngine.class.getMethod("getApplicationProtocol");
if (LOG.isDebugEnabled())
LOG.debug("Using OpenJDK ALPN APIs instead of Jetty ALPN APIs");
return;
}
catch (NoSuchMethodException ignored)
catch (NoSuchMethodException x)
{
LOG.ignore(x);
}

// Backported ALPN APIs not available.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ public void init()
// JDK 8u252 has the JDK 9 ALPN API backported.
// Use reflection so we can build with a JDK version less than 8u252.
alpnSelector = SSLEngine.class.getMethod("setHandshakeApplicationProtocolSelector", BiFunction.class);
if (LOG.isDebugEnabled())
LOG.debug("Using OpenJDK ALPN APIs instead of Jetty ALPN APIs");
return;
}
catch (NoSuchMethodException ignored)
catch (NoSuchMethodException x)
{
LOG.ignore(x);
}

// Backported ALPN APIs not available.
Expand Down

0 comments on commit 1be2f47

Please sign in to comment.