Class SslFilter
java.lang.Object
org.glassfish.jersey.jdk.connector.internal.Filter<ByteBuffer, ByteBuffer, ByteBuffer, ByteBuffer>
org.glassfish.jersey.jdk.connector.internal.SslFilter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static enumprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufferprivate final HostnameVerifierprivate static final ByteBufferprivate final ByteBufferprivate Runnableprivate final Stringprivate final SSLEngineprivate SslFilter.Stateprivate final SslFilter.WriteQueueFields inherited from class Filter
downstreamFilter, upstreamFilter -
Constructor Summary
ConstructorsConstructorDescriptionSslFilter(Filter<ByteBuffer, ByteBuffer, ?, ?> downstreamFilter, SSLContext sslContext, String serverHost, HostnameVerifier customHostnameVerifier) SSL Filter constructor, takes upstream filter as a parameter. -
Method Summary
Modifier and TypeMethodDescription(package private) voidclose()Close the filter, invokes close operation on the next filter in the filter chain.private booleandoHandshakeStep(ByteBuffer networkData) private StringReturns a printed current state of the SslFilter that could be helpful for troubleshooting.private voidprivate voidhandlePostWrite(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) private booleanhandleRead(ByteBuffer networkData) private voidprivate voidhandleWrite(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) (package private) booleanprocessRead(ByteBuffer networkData) ProcessFilter.onRead(Object).(package private) voidOnly for test.(package private) voidstartSsl()Signal to turn on SSL, it is passed on in the filter chain until a filter responsible for SSL is reached.private voidstorePendingApplicationWrite(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) (package private) voidwrite(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) Perform write operation for this filter and invokes write method on the next filter in the filter chain.Methods inherited from class Filter
connect, handleConnect, onConnect, onConnectionClosed, onError, onRead, onSslHandshakeCompleted, processConnect, processConnectionClosed, processError, processSslHandshakeCompleted
-
Field Details
-
emptyBuffer
-
applicationInputBuffer
-
networkOutputBuffer
-
sslEngine
-
customHostnameVerifier
-
serverHost
-
writeQueue
-
state
-
pendingApplicationWrite
-
-
Constructor Details
-
SslFilter
SslFilter(Filter<ByteBuffer, ByteBuffer, ?, ?> downstreamFilter, SSLContext sslContext, String serverHost, HostnameVerifier customHostnameVerifier) SSL Filter constructor, takes upstream filter as a parameter.- Parameters:
downstreamFilter- a filter that is positioned under the SSL filter.sslContext- configuration of SSL engine.serverHost- server host (hostname or IP address), which will be used to verify authenticity of the server (the provided host will be compared against the host in the certificate provided by the server). IP address and hostname cannot be used interchangeably - if a certificate contains hostname and an IP address of the server is provided here, the verification will fail.customHostnameVerifier- hostname verifier that will be used instead of the default one.
-
-
Method Details
-
write
Description copied from class:FilterPerform write operation for this filter and invokes write method on the next filter in the filter chain.- Overrides:
writein classFilter<ByteBuffer, ByteBuffer, ByteBuffer, ByteBuffer>- Parameters:
applicationData- on which write operation is performed.completionHandler- will be invoked when the write operation is completed or has failed.
-
handleWrite
private void handleWrite(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) -
handlePostWrite
private void handlePostWrite(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) -
storePendingApplicationWrite
private void storePendingApplicationWrite(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) -
close
void close()Description copied from class:FilterClose the filter, invokes close operation on the next filter in the filter chain. The filter is expected to clean up any allocated resources and pass the invocation to downstream filter.- Overrides:
closein classFilter<ByteBuffer, ByteBuffer, ByteBuffer, ByteBuffer>
-
processRead
Description copied from class:FilterProcessFilter.onRead(Object).- Overrides:
processReadin classFilter<ByteBuffer, ByteBuffer, ByteBuffer, ByteBuffer>- Parameters:
networkData- read data.- Returns:
trueif the data should be sent to processing to upper filter in the chain,falseotherwise.
-
handleRead
-
doHandshakeStep
-
handleHandshakeFinished
private void handleHandshakeFinished() -
handleSslError
-
startSsl
void startSsl()Description copied from class:FilterSignal to turn on SSL, it is passed on in the filter chain until a filter responsible for SSL is reached.- Overrides:
startSslin classFilter<ByteBuffer, ByteBuffer, ByteBuffer, ByteBuffer>
-
rehandshake
void rehandshake()Only for test. -
getDebugState
Returns a printed current state of the SslFilter that could be helpful for troubleshooting.
-