public class SSLBaseFilter extends BaseFilter
Filter to operate with SSL encrypted data.| Modifier and Type | Class and Description |
|---|---|
static class |
SSLBaseFilter.CertificateEvent |
static interface |
SSLBaseFilter.HandshakeListener |
protected static class |
SSLBaseFilter.SSLTransportFilterWrapper |
| Modifier and Type | Field and Description |
|---|---|
protected static MessageCloner<Buffer> |
COPY_CLONER |
protected Set<SSLBaseFilter.HandshakeListener> |
handshakeListeners |
| Constructor and Description |
|---|
SSLBaseFilter() |
SSLBaseFilter(SSLEngineConfigurator serverSSLEngineConfigurator)
Build SSLFilter with the given
SSLEngineConfigurator. |
SSLBaseFilter(SSLEngineConfigurator serverSSLEngineConfigurator,
boolean renegotiateOnClientAuthWant)
Build SSLFilter with the given
SSLEngineConfigurator. |
createContext, exceptionOccurred, handleAccept, handleClose, handleConnect, onFilterChainChanged, toStringprotected static final MessageCloner<Buffer> COPY_CLONER
protected final Set<SSLBaseFilter.HandshakeListener> handshakeListeners
public SSLBaseFilter()
public SSLBaseFilter(SSLEngineConfigurator serverSSLEngineConfigurator)
SSLEngineConfigurator.serverSSLEngineConfigurator - SSLEngine configurator for server side connectionspublic SSLBaseFilter(SSLEngineConfigurator serverSSLEngineConfigurator, boolean renegotiateOnClientAuthWant)
SSLEngineConfigurator.serverSSLEngineConfigurator - SSLEngine configurator for server side connectionsrenegotiateOnClientAuthWant - true, if SSLBaseFilter has to force client authentication
during re-handshake, in case the client didn't send its credentials
during the initial handshake in response to "wantClientAuth" flag.
In this case "needClientAuth" flag will be raised and re-handshake
will be initiatedpublic boolean isRenegotiateOnClientAuthWant()
public SSLEngineConfigurator getServerSSLEngineConfigurator()
SSLEngineConfigurator used by the filter to create new
SSLEngine for server-side Connectionspublic void addHandshakeListener(SSLBaseFilter.HandshakeListener listener)
public void removeHandshakeListener(SSLBaseFilter.HandshakeListener listener)
public long getHandshakeTimeout(TimeUnit timeUnit)
timeUnit - TimeUnit-1 if blocking handshake mode
is disabled (default).public void setHandshakeTimeout(long handshakeTimeout,
TimeUnit timeUnit)
handshakeTimeout - timeout value, or -1 means for
non-blocking handshake mode.timeUnit - TimeUnitpublic void setRenegotiationDisabled(boolean renegotiationDisabled)
renegotiationDisabled - true to disable renegotiation.protected SSLBaseFilter.SSLTransportFilterWrapper getOptimizedTransportFilter(TransportFilter childFilter)
protected SSLBaseFilter.SSLTransportFilterWrapper createOptimizedTransportFilter(TransportFilter childFilter)
public void onRemoved(FilterChain filterChain)
BaseFilterFilterChain.onRemoved in interface FilteronRemoved in class BaseFilterfilterChain - the FilterChain this Filter was removed from.public void onAdded(FilterChain filterChain)
BaseFilterFilterChain.onAdded in interface FilteronAdded in class BaseFilterfilterChain - the FilterChain this Filter was added to.public NextAction handleEvent(FilterChainContext ctx, FilterChainEvent event) throws IOException
BaseFilterConnection.
This Filter may either complete the required processing and
return StopAction, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning InvokeAction.handleEvent in interface FilterhandleEvent in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it
should continue the executionIOExceptionpublic NextAction handleRead(FilterChainContext ctx) throws IOException
BaseFilterFilter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.handleRead in interface FilterhandleRead in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it
should continue the executionIOExceptionpublic NextAction handleWrite(FilterChainContext ctx) throws IOException
BaseFilterFilter may either complete the required processing and
return false, or delegate remaining processing to the next
Filter in a FilterChain containing this Filter
by returning true.handleWrite in interface FilterhandleWrite in class BaseFilterctx - FilterChainContextNextAction instruction for FilterChain, how it
should continue the executionIOExceptionprotected NextAction unwrapAll(FilterChainContext ctx, SSLConnectionContext sslCtx) throws SSLException
SSLExceptionprotected Buffer wrapAll(FilterChainContext ctx, SSLConnectionContext sslCtx) throws SSLException
SSLExceptionprotected Buffer doHandshakeSync(SSLConnectionContext sslCtx, FilterChainContext ctx, Buffer inputBuffer, long timeoutMillis) throws IOException
IOExceptionprotected Buffer doHandshakeStep(SSLConnectionContext sslCtx, FilterChainContext ctx, Buffer inputBuffer) throws IOException
IOExceptionprotected Buffer doHandshakeStep(SSLConnectionContext sslCtx, FilterChainContext ctx, Buffer inputBuffer, Buffer tmpAppBuffer0) throws IOException
IOExceptionprotected void renegotiate(SSLConnectionContext sslCtx, FilterChainContext context) throws IOException
sslCtx - the SSLConnectionContext associated with this
this renegotiation request.context - the FilterChainContext associated with this
this renegotiation request.IOException - if an error occurs during SSL renegotiation.protected void getPeerCertificateChain(SSLConnectionContext sslCtx, FilterChainContext context, boolean needClientAuth, FutureImpl<Object[]> certFuture)
Obtains the certificate chain for this SSL session. If no certificates
are available, and needClientAuth is true, an SSL renegotiation
will be be triggered to request the certificates from the client.
sslCtx - the SSLConnectionContext associated with this
certificate request.context - the FilterChainContext associated with this
this certificate request.needClientAuth - determines whether or not SSL renegotiation will
be attempted to obtain the certificate chain.certFuture - the future that will be provided the result of the
peer certificate processing.protected SSLConnectionContext obtainSslConnectionContext(Connection connection)
protected SSLConnectionContext createSslConnectionContext(Connection connection)
protected void notifyHandshakeStart(Connection connection)
protected void notifyHandshakeComplete(Connection<?> connection, SSLEngine sslEngine)
protected void notifyHandshakeFailed(Connection connection, Throwable t)
Copyright © 2017–2019 Oracle Corporation. All rights reserved.