Package io.undertow.protocols.ssl
Class ALPNHackSSLEngine
- java.lang.Object
-
- javax.net.ssl.SSLEngine
-
- io.undertow.protocols.ssl.ALPNHackSSLEngine
-
public class ALPNHackSSLEngine extends javax.net.ssl.SSLEngineSSLEngine 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 Modifier and Type Field Description static booleanENABLED
-
Constructor Summary
Constructors Constructor Description ALPNHackSSLEngine(javax.net.ssl.SSLEngine delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginHandshake()voidcloseInbound()voidcloseOutbound()java.util.List<java.lang.String>getApplicationProtocols()JDK8 ALPN hack support method.java.lang.RunnablegetDelegatedTask()java.lang.String[]getEnabledCipherSuites()java.lang.String[]getEnabledProtocols()booleangetEnableSessionCreation()javax.net.ssl.SSLEngineResult.HandshakeStatusgetHandshakeStatus()booleangetNeedClientAuth()java.lang.StringgetSelectedApplicationProtocol()JDK8 ALPN hack support method.javax.net.ssl.SSLSessiongetSession()java.lang.String[]getSupportedCipherSuites()java.lang.String[]getSupportedProtocols()booleangetUseClientMode()booleangetWantClientAuth()static booleanisEnabled(javax.net.ssl.SSLEngine engine)booleanisInboundDone()booleanisOutboundDone()voidsetApplicationProtocols(java.util.List<java.lang.String> applicationProtocols)JDK8 ALPN hack support method.voidsetEnabledCipherSuites(java.lang.String[] strings)voidsetEnabledProtocols(java.lang.String[] strings)voidsetEnableSessionCreation(boolean b)voidsetNeedClientAuth(boolean b)voidsetUseClientMode(boolean b)voidsetWantClientAuth(boolean b)javax.net.ssl.SSLEngineResultunwrap(java.nio.ByteBuffer dataToUnwrap, java.nio.ByteBuffer[] byteBuffers, int i, int i1)javax.net.ssl.SSLEngineResultwrap(java.nio.ByteBuffer[] byteBuffers, int i, int i1, java.nio.ByteBuffer byteBuffer)-
Methods inherited from class javax.net.ssl.SSLEngine
getApplicationProtocol, getHandshakeApplicationProtocol, getHandshakeApplicationProtocolSelector, getHandshakeSession, getPeerHost, getPeerPort, getSSLParameters, setHandshakeApplicationProtocolSelector, setSSLParameters, unwrap, unwrap, wrap, wrap
-
-
-
-
Method Detail
-
isEnabled
public static boolean isEnabled(javax.net.ssl.SSLEngine engine)
-
wrap
public javax.net.ssl.SSLEngineResult wrap(java.nio.ByteBuffer[] byteBuffers, int i, int i1, java.nio.ByteBuffer byteBuffer) throws javax.net.ssl.SSLException- Specified by:
wrapin classjavax.net.ssl.SSLEngine- Throws:
javax.net.ssl.SSLException
-
unwrap
public javax.net.ssl.SSLEngineResult unwrap(java.nio.ByteBuffer dataToUnwrap, java.nio.ByteBuffer[] byteBuffers, int i, int i1) throws javax.net.ssl.SSLException- Specified by:
unwrapin classjavax.net.ssl.SSLEngine- Throws:
javax.net.ssl.SSLException
-
getDelegatedTask
public java.lang.Runnable getDelegatedTask()
- Specified by:
getDelegatedTaskin classjavax.net.ssl.SSLEngine
-
closeInbound
public void closeInbound() throws javax.net.ssl.SSLException- Specified by:
closeInboundin classjavax.net.ssl.SSLEngine- Throws:
javax.net.ssl.SSLException
-
isInboundDone
public boolean isInboundDone()
- Specified by:
isInboundDonein classjavax.net.ssl.SSLEngine
-
closeOutbound
public void closeOutbound()
- Specified by:
closeOutboundin classjavax.net.ssl.SSLEngine
-
isOutboundDone
public boolean isOutboundDone()
- Specified by:
isOutboundDonein classjavax.net.ssl.SSLEngine
-
getSupportedCipherSuites
public java.lang.String[] getSupportedCipherSuites()
- Specified by:
getSupportedCipherSuitesin classjavax.net.ssl.SSLEngine
-
getEnabledCipherSuites
public java.lang.String[] getEnabledCipherSuites()
- Specified by:
getEnabledCipherSuitesin classjavax.net.ssl.SSLEngine
-
setEnabledCipherSuites
public void setEnabledCipherSuites(java.lang.String[] strings)
- Specified by:
setEnabledCipherSuitesin classjavax.net.ssl.SSLEngine
-
getSupportedProtocols
public java.lang.String[] getSupportedProtocols()
- Specified by:
getSupportedProtocolsin classjavax.net.ssl.SSLEngine
-
getEnabledProtocols
public java.lang.String[] getEnabledProtocols()
- Specified by:
getEnabledProtocolsin classjavax.net.ssl.SSLEngine
-
setEnabledProtocols
public void setEnabledProtocols(java.lang.String[] strings)
- Specified by:
setEnabledProtocolsin classjavax.net.ssl.SSLEngine
-
getSession
public javax.net.ssl.SSLSession getSession()
- Specified by:
getSessionin classjavax.net.ssl.SSLEngine
-
beginHandshake
public void beginHandshake() throws javax.net.ssl.SSLException- Specified by:
beginHandshakein classjavax.net.ssl.SSLEngine- Throws:
javax.net.ssl.SSLException
-
getHandshakeStatus
public javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus()
- Specified by:
getHandshakeStatusin classjavax.net.ssl.SSLEngine
-
setUseClientMode
public void setUseClientMode(boolean b)
- Specified by:
setUseClientModein classjavax.net.ssl.SSLEngine
-
getUseClientMode
public boolean getUseClientMode()
- Specified by:
getUseClientModein classjavax.net.ssl.SSLEngine
-
setNeedClientAuth
public void setNeedClientAuth(boolean b)
- Specified by:
setNeedClientAuthin classjavax.net.ssl.SSLEngine
-
getNeedClientAuth
public boolean getNeedClientAuth()
- Specified by:
getNeedClientAuthin classjavax.net.ssl.SSLEngine
-
setWantClientAuth
public void setWantClientAuth(boolean b)
- Specified by:
setWantClientAuthin classjavax.net.ssl.SSLEngine
-
getWantClientAuth
public boolean getWantClientAuth()
- Specified by:
getWantClientAuthin classjavax.net.ssl.SSLEngine
-
setEnableSessionCreation
public void setEnableSessionCreation(boolean b)
- Specified by:
setEnableSessionCreationin classjavax.net.ssl.SSLEngine
-
getEnableSessionCreation
public boolean getEnableSessionCreation()
- Specified by:
getEnableSessionCreationin classjavax.net.ssl.SSLEngine
-
setApplicationProtocols
public void setApplicationProtocols(java.util.List<java.lang.String> applicationProtocols)
JDK8 ALPN hack support method. These methods will be removed once JDK8 ALPN support is no longer required- Parameters:
applicationProtocols-
-
getApplicationProtocols
public java.util.List<java.lang.String> getApplicationProtocols()
JDK8 ALPN hack support method. These methods will be removed once JDK8 ALPN support is no longer required
-
getSelectedApplicationProtocol
public java.lang.String getSelectedApplicationProtocol()
JDK8 ALPN hack support method. These methods will be removed once JDK8 ALPN support is no longer required
-
-