pgyori commented on code in PR #6032:
URL: https://github.com/apache/nifi/pull/6032#discussion_r872569617
##########
nifi-nar-bundles/nifi-extension-utils/nifi-event-transport/src/main/java/org/apache/nifi/event/transport/netty/codec/SocketByteArrayMessageDecoder.java:
##########
@@ -38,7 +48,37 @@ public class SocketByteArrayMessageDecoder extends
MessageToMessageDecoder<byte[
protected void decode(final ChannelHandlerContext channelHandlerContext,
final byte[] bytes, final List<Object> decoded) {
final InetSocketAddress remoteAddress = (InetSocketAddress)
channelHandlerContext.channel().remoteAddress();
final String address = remoteAddress.getHostString();
- final ByteArrayMessage message = new ByteArrayMessage(bytes, address);
+
+ final SslSessionStatus sslSessionStatus =
getSslSessionStatus(channelHandlerContext);
+ final ByteArrayMessage message = new ByteArrayMessage(bytes, address,
sslSessionStatus);
+
decoded.add(message);
}
+
+ private SslSessionStatus getSslSessionStatus(final ChannelHandlerContext
channelHandlerContext) {
+ final Iterator<Map.Entry<String, ChannelHandler>> iterator =
channelHandlerContext.channel().pipeline().iterator();
+ while (iterator.hasNext()) {
+ final ChannelHandler channelHandler = iterator.next().getValue();
+ if (channelHandler instanceof SslHandler) {
+ return createSslSessionStatusFromSslHandler((SslHandler)
channelHandler);
+ }
+ }
+ return null;
Review Comment:
Thank you! I applied your suggested change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]