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 class
private static enum
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBuffer
private final HostnameVerifier
private static final ByteBuffer
private final ByteBuffer
private Runnable
private final String
private final SSLEngine
private SslFilter.State
private final SslFilter.WriteQueue
Fields inherited from class org.glassfish.jersey.jdk.connector.internal.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) void
close()
Close the filter, invokes close operation on the next filter in the filter chain.private boolean
doHandshakeStep
(ByteBuffer networkData) private String
Returns a printed current state of the SslFilter that could be helpful for troubleshooting.private void
private void
handlePostWrite
(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) private boolean
handleRead
(ByteBuffer networkData) private void
private void
handleWrite
(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) (package private) boolean
processRead
(ByteBuffer networkData) ProcessFilter.onRead(Object)
.(package private) void
Only for test.(package private) void
startSsl()
Signal to turn on SSL, it is passed on in the filter chain until a filter responsible for SSL is reached.private void
storePendingApplicationWrite
(ByteBuffer applicationData, CompletionHandler<ByteBuffer> completionHandler) (package private) void
write
(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 org.glassfish.jersey.jdk.connector.internal.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:Filter
Perform write operation for this filter and invokes write method on the next filter in the filter chain.- Overrides:
write
in 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:Filter
Close 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:
close
in classFilter<ByteBuffer,
ByteBuffer, ByteBuffer, ByteBuffer>
-
processRead
Description copied from class:Filter
ProcessFilter.onRead(Object)
.- Overrides:
processRead
in classFilter<ByteBuffer,
ByteBuffer, ByteBuffer, ByteBuffer> - Parameters:
networkData
- read data.- Returns:
true
if the data should be sent to processing to upper filter in the chain,false
otherwise.
-
handleRead
-
doHandshakeStep
-
handleHandshakeFinished
private void handleHandshakeFinished() -
handleSslError
-
startSsl
void startSsl()Description copied from class:Filter
Signal to turn on SSL, it is passed on in the filter chain until a filter responsible for SSL is reached.- Overrides:
startSsl
in 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.
-