chrisdutz commented on issue #2173:
URL: https://github.com/apache/plc4x/issues/2173#issuecomment-3068000786
Another approach, might be not to implement a new transport, but a second
driver class, which generally only adds one more layer to the stack. (Or leave
it at one, but add a configuration option).
This code is just ChatGPT made-up stuff, but the part here it adds the
sslCtx.newHandler looks legit and it pretty much in-line with what I saw
elsewhere.
`
SslContext sslCtx = SslContextBuilder
.forClient()
.trustManager(new File("your-truststore.crt")) // or use
InsecureTrustManagerFactory.INSTANCE for testing
.build();
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(group)
.channel(NioSocketChannel.class)
.handler(new ChannelInitializer<SocketChannel>() {
@Override
public void initChannel(SocketChannel ch) {
ChannelPipeline p = ch.pipeline();
p.addLast(sslCtx.newHandler(ch.alloc(), "remote-ip", 8016));
p.addLast(new AdsFrameDecoder()); // Your ADS
parser/decoder
p.addLast(new AdsClientHandler());
}
});
`
--
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]