Class SslMasterKeyHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.ssl.SslMasterKeyHandler
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
The
SslMasterKeyHandler is a channel-handler you can include in your pipeline to consume the master key
invalid input: '&' session identifier for a TLS session.
This can be very useful, for instance the SslMasterKeyHandler.WiresharkSslMasterKeyHandler implementation will
log the secret invalid input: '&' identifier in a format that is consumable by Wireshark -- allowing easy decryption of pcap/tcpdumps.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA system property that can be used to turn on/off theSslMasterKeyHandlerdynamically without having to edit your pipeline. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaccept(SecretKey masterKey, SSLSession session) Consume the master key for the session and the sessionIdstatic voidEnsure that SSLSessionImpl is available.static booleanprotected booleanChecks if the handler is set up to actually handle/accept the event.static SslMasterKeyHandlerCreate aSslMasterKeyHandler.WiresharkSslMasterKeyHandlerinstance.static ThrowableReturns the cause of unavailability.final voiduserEventTriggered(ChannelHandlerContext ctx, Object evt) CallsChannelHandlerContext.fireUserEventTriggered(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.Methods inherited from class ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
SYSTEM_PROP_KEY
A system property that can be used to turn on/off theSslMasterKeyHandlerdynamically without having to edit your pipeline.-Dio.netty.ssl.masterKeyHandler=true- See Also:
-
-
Constructor Details
-
SslMasterKeyHandler
protected SslMasterKeyHandler()Constructor.
-
-
Method Details
-
ensureSunSslEngineAvailability
public static void ensureSunSslEngineAvailability()Ensure that SSLSessionImpl is available.- Throws:
UnsatisfiedLinkError- if unavailable
-
isSunSslEngineAvailable
public static boolean isSunSslEngineAvailable() -
accept
Consume the master key for the session and the sessionId- Parameters:
masterKey- A 48-byte secret shared between the client and server.session- The current TLS session
-
userEventTriggered
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireUserEventTriggered(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
userEventTriggeredin interfaceChannelInboundHandler- Overrides:
userEventTriggeredin classChannelInboundHandlerAdapter
-
masterKeyHandlerEnabled
protected boolean masterKeyHandlerEnabled()Checks if the handler is set up to actually handle/accept the event. By default theSYSTEM_PROP_KEYproperty is checked, but any implementations of this class are free to override if they have different mechanisms of checking.- Returns:
- true if it should handle, false otherwise.
-
newWireSharkSslMasterKeyHandler
Create aSslMasterKeyHandler.WiresharkSslMasterKeyHandlerinstance. This TLS master key handler logs the master key and session-id in a format understood by Wireshark -- this can be especially useful if you need to ever decrypt a TLS session and are using perfect forward secrecy (i.e. Diffie-Hellman) The key and session identifier are forwarded to the log named 'io.netty.wireshark'.
-