public class SNIFilter extends SSLFilter
Filter implementation.
This filter supports SNI extension on both client and server sides, however
the client side logic works on JDK 7+ only.
On the server-side this filter allows developers to set custom
SSLEngineConfigurator, based on the host name provided by the client
in the SSL CLIENT_HELLO message.
An SNIServerConfigResolver registered via setServerSSLConfigResolver(org.glassfish.grizzly.sni.SNIServerConfigResolver)
would be responsible for customizing SSLEngineConfigurator.
On the other hand for client-side it's not mandatory to register SNIClientConfigResolver,
because the host name information could be obtained from the Connection.getPeerAddress().
However SNIClientConfigResolver could be used to customize the host name.SSLBaseFilter.CertificateEvent, SSLBaseFilter.HandshakeListener, SSLBaseFilter.SSLTransportFilterWrappermaxPendingBytesCOPY_CLONER, handshakeListeners| Constructor and Description |
|---|
SNIFilter() |
SNIFilter(SSLEngineConfigurator serverSSLEngineConfigurator,
SSLEngineConfigurator clientSSLEngineConfigurator)
Construct an SNIFilter with the given default client and server
side
SSLEngineConfigurator. |
SNIFilter(SSLEngineConfigurator serverSSLEngineConfigurator,
SSLEngineConfigurator clientSSLEngineConfigurator,
boolean renegotiateOnClientAuthWant)
Construct an SNIFilter with the given default
SSLEngineConfigurator. |
| Modifier and Type | Method and Description |
|---|---|
protected SSLBaseFilter.SSLTransportFilterWrapper |
createOptimizedTransportFilter(TransportFilter childFilter) |
SNIClientConfigResolver |
getClientSSLConfigResolver() |
SNIServerConfigResolver |
getServerSSLConfigResolver() |
NextAction |
handleConnect(FilterChainContext ctx) |
NextAction |
handleRead(FilterChainContext ctx) |
void |
setClientSSLConfigResolver(SNIClientConfigResolver resolver)
Sets
SNIClientConfigResolver, which is responsible for customizing
SSLEngineConfigurator and SNI host name to be sent to a server. |
void |
setServerSSLConfigResolver(SNIServerConfigResolver resolver)
Sets
SNIServerConfigResolver, which is responsible for customizing
SSLEngineConfigurator for newly accepted Connections,
based on SNI host name information sent by a client. |
createClientSSLEngine, doHandshakeStep, getClientSSLEngineConfigurator, getMaxPendingBytesPerConnection, handleWrite, handshake, handshake, handshake, handshake, notifyHandshakeComplete, notifyHandshakeFailed, setMaxPendingBytesPerConnectionaddHandshakeListener, createSslConnectionContext, doHandshakeStep, doHandshakeSync, getHandshakeTimeout, getOptimizedTransportFilter, getPeerCertificateChain, getServerSSLEngineConfigurator, handleEvent, isRenegotiateOnClientAuthWant, notifyHandshakeStart, obtainSslConnectionContext, onAdded, onRemoved, removeHandshakeListener, renegotiate, setHandshakeTimeout, setRenegotiationDisabled, unwrapAll, wrapAllcreateContext, exceptionOccurred, handleAccept, handleClose, onFilterChainChanged, toStringpublic SNIFilter()
public SNIFilter(SSLEngineConfigurator serverSSLEngineConfigurator, SSLEngineConfigurator clientSSLEngineConfigurator)
SSLEngineConfigurator.serverSSLEngineConfigurator - clientSSLEngineConfigurator - public SNIFilter(SSLEngineConfigurator serverSSLEngineConfigurator, SSLEngineConfigurator clientSSLEngineConfigurator, boolean renegotiateOnClientAuthWant)
SSLEngineConfigurator.serverSSLEngineConfigurator - SSLEngine configurator for server side connectionsclientSSLEngineConfigurator - SSLEngine configurator for client side connectionsrenegotiateOnClientAuthWant - public SNIServerConfigResolver getServerSSLConfigResolver()
SNIServerConfigResolver, which is responsible for customizing
SSLEngineConfigurator for newly accepted Connections,
based on SNI host name information sent by a clientpublic void setServerSSLConfigResolver(SNIServerConfigResolver resolver)
SNIServerConfigResolver, which is responsible for customizing
SSLEngineConfigurator for newly accepted Connections,
based on SNI host name information sent by a client.resolver - SNIServerConfigResolverpublic SNIClientConfigResolver getClientSSLConfigResolver()
SNIClientConfigResolver, which is responsible for customizing
SSLEngineConfigurator and SNI host name to be sent to a serverpublic void setClientSSLConfigResolver(SNIClientConfigResolver resolver)
SNIClientConfigResolver, which is responsible for customizing
SSLEngineConfigurator and SNI host name to be sent to a server.resolver - protected SSLBaseFilter.SSLTransportFilterWrapper createOptimizedTransportFilter(TransportFilter childFilter)
createOptimizedTransportFilter in class SSLBaseFilterpublic NextAction handleConnect(FilterChainContext ctx) throws java.io.IOException
handleConnect in interface FilterhandleConnect in class BaseFilterjava.io.IOExceptionpublic NextAction handleRead(FilterChainContext ctx) throws java.io.IOException
handleRead in interface FilterhandleRead in class SSLBaseFilterjava.io.IOExceptionCopyright © 2018 Oracle Corporation. All Rights Reserved.