Package io.undertow.protocols.ssl
Class ALPNHackSSLEngine
java.lang.Object
javax.net.ssl.SSLEngine
io.undertow.protocols.ssl.ALPNHackSSLEngine
SSLEngine wrapper that provides some super hacky ALPN support on JDK8.
Even though this is a nasty hack that relies on JDK internals it is still preferable to modifying the boot class path.
It is expected to work with all JDK8 versions, however this cannot be guaranteed if the SSL internals are changed
in an incompatible way.
This class will go away once JDK8 is no longer in use.
- Author:
- Stuart Douglas
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
JDK8 ALPN hack support method.String[]
String[]
boolean
boolean
JDK8 ALPN hack support method.String[]
String[]
boolean
boolean
static boolean
boolean
boolean
void
setApplicationProtocols
(List<String> applicationProtocols) JDK8 ALPN hack support method.void
setEnabledCipherSuites
(String[] strings) void
setEnabledProtocols
(String[] strings) void
setEnableSessionCreation
(boolean b) void
setNeedClientAuth
(boolean b) void
setUseClientMode
(boolean b) void
setWantClientAuth
(boolean b) unwrap
(ByteBuffer dataToUnwrap, ByteBuffer[] byteBuffers, int i, int i1) wrap
(ByteBuffer[] byteBuffers, int i, int i1, ByteBuffer byteBuffer) Methods inherited from class javax.net.ssl.SSLEngine
getApplicationProtocol, getHandshakeApplicationProtocol, getHandshakeApplicationProtocolSelector, getHandshakeSession, getPeerHost, getPeerPort, getSSLParameters, setHandshakeApplicationProtocolSelector, setSSLParameters, unwrap, unwrap, wrap, wrap
-
Field Details
-
ENABLED
public static final boolean ENABLED
-
-
Constructor Details
-
ALPNHackSSLEngine
-
-
Method Details
-
isEnabled
-
wrap
public SSLEngineResult wrap(ByteBuffer[] byteBuffers, int i, int i1, ByteBuffer byteBuffer) throws SSLException - Specified by:
wrap
in classSSLEngine
- Throws:
SSLException
-
unwrap
public SSLEngineResult unwrap(ByteBuffer dataToUnwrap, ByteBuffer[] byteBuffers, int i, int i1) throws SSLException - Specified by:
unwrap
in classSSLEngine
- Throws:
SSLException
-
getDelegatedTask
- Specified by:
getDelegatedTask
in classSSLEngine
-
closeInbound
- Specified by:
closeInbound
in classSSLEngine
- Throws:
SSLException
-
isInboundDone
public boolean isInboundDone()- Specified by:
isInboundDone
in classSSLEngine
-
closeOutbound
public void closeOutbound()- Specified by:
closeOutbound
in classSSLEngine
-
isOutboundDone
public boolean isOutboundDone()- Specified by:
isOutboundDone
in classSSLEngine
-
getSupportedCipherSuites
- Specified by:
getSupportedCipherSuites
in classSSLEngine
-
getEnabledCipherSuites
- Specified by:
getEnabledCipherSuites
in classSSLEngine
-
setEnabledCipherSuites
- Specified by:
setEnabledCipherSuites
in classSSLEngine
-
getSupportedProtocols
- Specified by:
getSupportedProtocols
in classSSLEngine
-
getEnabledProtocols
- Specified by:
getEnabledProtocols
in classSSLEngine
-
setEnabledProtocols
- Specified by:
setEnabledProtocols
in classSSLEngine
-
getSession
- Specified by:
getSession
in classSSLEngine
-
beginHandshake
- Specified by:
beginHandshake
in classSSLEngine
- Throws:
SSLException
-
getHandshakeStatus
- Specified by:
getHandshakeStatus
in classSSLEngine
-
setUseClientMode
public void setUseClientMode(boolean b) - Specified by:
setUseClientMode
in classSSLEngine
-
getUseClientMode
public boolean getUseClientMode()- Specified by:
getUseClientMode
in classSSLEngine
-
setNeedClientAuth
public void setNeedClientAuth(boolean b) - Specified by:
setNeedClientAuth
in classSSLEngine
-
getNeedClientAuth
public boolean getNeedClientAuth()- Specified by:
getNeedClientAuth
in classSSLEngine
-
setWantClientAuth
public void setWantClientAuth(boolean b) - Specified by:
setWantClientAuth
in classSSLEngine
-
getWantClientAuth
public boolean getWantClientAuth()- Specified by:
getWantClientAuth
in classSSLEngine
-
setEnableSessionCreation
public void setEnableSessionCreation(boolean b) - Specified by:
setEnableSessionCreation
in classSSLEngine
-
getEnableSessionCreation
public boolean getEnableSessionCreation()- Specified by:
getEnableSessionCreation
in classSSLEngine
-
setApplicationProtocols
JDK8 ALPN hack support method. These methods will be removed once JDK8 ALPN support is no longer required- Parameters:
applicationProtocols
-
-
getApplicationProtocols
JDK8 ALPN hack support method. These methods will be removed once JDK8 ALPN support is no longer required -
getSelectedApplicationProtocol
JDK8 ALPN hack support method. These methods will be removed once JDK8 ALPN support is no longer required
-