Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.ssl

public Class SSLBaseFilter

extends BaseFilter
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.ssl.SSLFilter
Static Imports
org.glassfish.grizzly.ssl.SSLUtils.SSL_CTX_ATTR, .SSLUtils.allocateInputBuffer, .SSLUtils.allocateOutputBuffer, .SSLUtils.allowDispose, .SSLUtils.copy, .SSLUtils.executeDelegatedTask, .SSLUtils.getSSLPacketSize, .SSLUtils.getSslConnectionContext, .SSLUtils.handshakeUnwrap, .SSLUtils.handshakeWrap, .SSLUtils.isHandshaking, .SSLUtils.makeInputRemainder, .SSLUtils.move

SSL Filter to operate with SSL encrypted data.
Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static interface
private static class
private static class
protected static class

Field Summary

Modifier and TypeField and Description
protected static final MessageCloner<Buffer>
protected final Set<SSLBaseFilter.HandshakeListener>
private long
private static final Logger
private static final SSLConnectionContext.Allocator
private SSLBaseFilter.SSLTransportFilterWrapper
private static final SSLConnectionContext.Allocator
private final boolean
private volatile boolean
private final SSLEngineConfigurator

Constructor Summary

AccessConstructor and Description
public
public
SSLBaseFilter(SSLEngineConfigurator
SSLEngine configurator for server side connections
serverSSLEngineConfigurator
)

Build SSLFilter with the given SSLEngineConfigurator.

public
SSLBaseFilter(SSLEngineConfigurator
SSLEngine configurator for server side connections
serverSSLEngineConfigurator
,
boolean
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 initiated
renegotiateOnClientAuthWant
)

Build SSLFilter with the given SSLEngineConfigurator.

Method Summary

Modifier and TypeMethod and Description
public void
protected SSLBaseFilter.SSLTransportFilterWrapper
protected SSLConnectionContext
protected Buffer
doHandshakeStep(final SSLConnectionContext sslCtx, final FilterChainContext ctx, Buffer inputBuffer)

protected Buffer
doHandshakeStep(final SSLConnectionContext sslCtx, final FilterChainContext ctx, Buffer inputBuffer, final Buffer tmpAppBuffer0)

protected Buffer
doHandshakeSync(final SSLConnectionContext sslCtx, final FilterChainContext ctx, Buffer inputBuffer, final long timeoutMillis)

private static X509Certificate[]
public long
getHandshakeTimeout(final TimeUnit timeUnit)

Returns: the handshake timeout, -1 if blocking handshake mode is disabled (default).

protected SSLBaseFilter.SSLTransportFilterWrapper
protected void
getPeerCertificateChain(final SSLConnectionContext
the SSLConnectionContext associated with this certificate request.
sslCtx
,
final FilterChainContext
the FilterChainContext associated with this this certificate request.
context
,
final boolean
determines whether or not SSL renegotiation will be attempted to obtain the certificate chain.
needClientAuth
,
final FutureImpl<Object[]>
the future that will be provided the result of the peer certificate processing.
certFuture
)

Obtains the certificate chain for this SSL session.

private static Certificate[]
public SSLEngineConfigurator
getServerSSLEngineConfigurator()

Returns: SSLEngineConfigurator used by the filter to create new SSLEngine for server-side Connections

public NextAction
public NextAction
handleRead(final FilterChainContext ctx)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleRead.

Implements org.glassfish.grizzly.filterchain.Filter.handleRead.

Execute a unit of processing work to be performed, when channel will become available for reading.

public NextAction
handleWrite(final FilterChainContext ctx)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleWrite.

Implements org.glassfish.grizzly.filterchain.Filter.handleWrite.

Execute a unit of processing work to be performed, when some data should be written on channel.

public boolean
isRenegotiateOnClientAuthWant()

Returns: 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.

protected void
notifyHandshakeComplete(final Connection<?> connection, final SSLEngine sslEngine)

protected void
notifyHandshakeFailed(final Connection<L> connection, final Throwable t)

protected void
notifyHandshakeInit(final Connection<?> connection, final SSLEngine sslEngine)

protected void
notifyHandshakeStart(final Connection<L> connection)

private static FilterChainContext
obtainProtocolChainContext(final FilterChainContext ctx, final FilterChain completeProtocolFilterChain)

protected SSLConnectionContext
public void
onAdded(FilterChain filterChain)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.onAdded.

Implements org.glassfish.grizzly.filterchain.Filter.onAdded.

Method is called, when the Filter has been added to the passed FilterChain.

public void
onRemoved(final FilterChain filterChain)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.onRemoved.

Implements org.glassfish.grizzly.filterchain.Filter.onRemoved.

Method is called, when the Filter has been removed from the passed FilterChain.

private Buffer
public void
protected void
renegotiate(final SSLConnectionContext
the SSLConnectionContext associated with this this renegotiation request.
sslCtx
,
final FilterChainContext
the FilterChainContext associated with this this renegotiation request.
context
)

Performs an SSL renegotiation.

public void
setHandshakeTimeout(final long
timeout value, or -1 means for non-blocking handshake mode.
handshakeTimeout
,
final TimeUnit timeUnit)

Sets the handshake timeout.

public void
setRenegotiationDisabled(boolean
true to disable renegotiation.
renegotiationDisabled
)

Completely disables renegotiation.

private Buffer
protected NextAction
protected Buffer
Inherited from org.glassfish.grizzly.filterchain.BaseFilter:
createContextexceptionOccurredhandleAccepthandleClosehandleConnectonFilterChainChangedtoString