Issue #1770 NPE protection in SniX509EKM chooseServerAlias
Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
parent
375d7aa8da
commit
54bf9b56bf
|
@ -111,8 +111,7 @@ public class SniX509ExtendedKeyManager extends X509ExtendedKeyManager
|
||||||
public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)
|
public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)
|
||||||
{
|
{
|
||||||
SSLSocket sslSocket = (SSLSocket)socket;
|
SSLSocket sslSocket = (SSLSocket)socket;
|
||||||
|
String alias = socket==null?NO_MATCHERS:chooseServerAlias(keyType,issuers,sslSocket.getSSLParameters().getSNIMatchers(),sslSocket.getHandshakeSession());
|
||||||
String alias = chooseServerAlias(keyType,issuers,sslSocket.getSSLParameters().getSNIMatchers(),sslSocket.getHandshakeSession());
|
|
||||||
if (alias==NO_MATCHERS)
|
if (alias==NO_MATCHERS)
|
||||||
alias=_delegate.chooseServerAlias(keyType,issuers,socket);
|
alias=_delegate.chooseServerAlias(keyType,issuers,socket);
|
||||||
if (LOG.isDebugEnabled())
|
if (LOG.isDebugEnabled())
|
||||||
|
@ -123,7 +122,7 @@ public class SniX509ExtendedKeyManager extends X509ExtendedKeyManager
|
||||||
@Override
|
@Override
|
||||||
public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine)
|
public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine)
|
||||||
{
|
{
|
||||||
String alias = chooseServerAlias(keyType,issuers,engine.getSSLParameters().getSNIMatchers(),engine.getHandshakeSession());
|
String alias = engine==null?NO_MATCHERS:chooseServerAlias(keyType,issuers,engine.getSSLParameters().getSNIMatchers(),engine.getHandshakeSession());
|
||||||
if (alias==NO_MATCHERS)
|
if (alias==NO_MATCHERS)
|
||||||
alias=_delegate.chooseEngineServerAlias(keyType,issuers,engine);
|
alias=_delegate.chooseEngineServerAlias(keyType,issuers,engine);
|
||||||
if (LOG.isDebugEnabled())
|
if (LOG.isDebugEnabled())
|
||||||
|
|
Loading…
Reference in New Issue