Issue #486 - JDK 9 ALPN implementation.

Prevented NPEs in case there is no ALPN provider.
This commit is contained in:
Simone Bordet 2017-01-17 11:31:03 +01:00
parent 76e9849fcd
commit b6e603a467
2 changed files with 3 additions and 2 deletions

View File

@ -44,7 +44,8 @@ public class JDK9ClientALPNProcessor implements ALPNProcessor.Client
try
{
ALPN.ClientProvider provider = (ALPN.ClientProvider)ALPN.get(sslEngine);
provider.selected(sslEngine.getApplicationProtocol());
if (provider != null)
provider.selected(sslEngine.getApplicationProtocol());
}
catch (SSLException x)
{

View File

@ -46,7 +46,7 @@ public class JDK9ServerALPNProcessor implements ALPNProcessor.Server, SslHandsha
if (LOG.isDebugEnabled())
LOG.debug("ALPN selecting among client{}", protocols);
ALPN.ServerProvider provider = (ALPN.ServerProvider)ALPN.remove(sslEngine);
return provider.select(protocols);
return provider == null ? "" : provider.select(protocols);
}
catch (SSLException x)
{