Closed meteor199 closed 5 months ago
当使用 netty 4.1.109.Final 时,控制台无任何输出,会直接退出。
当使用 netty 4.1.109.Final 时,控制台无任何输出,会直接退出。
那可能是测试成功了。 这个测试默认并没有打印日志。
方法TLCPWithNettyDemo::tlcpDemo
中有如下行,
// System.setProperty("com.tencent.kona.ssl.debug", "all");
把它放开,就可以打印出握手的详细信息了。
netty: 4.1.63.Final
我用这个版本也会报错。
从4.1.66
开始,就没有问题了。
嗯嗯谢谢,升级版本后不会报错了。
不过好像无法正常发送消息,报 Encrypted Alert 21.
客户端出现channelInactive
channelRegistered
SslHandshakeCompletionEvent(SUCCESS)
SslCloseCompletionEvent(java.nio.channels.ClosedChannelException)
channelInactive
channelUnregistered
stop!
我更新了示例项目,运行可以重现,麻烦您了:https://github.com/meteor199/issue-kona-ssl
测试时只是连接一下就断开了,可能是由于这个原因。
那个Encrypted Alert是close_notify
?
com.tencent.kona.ssl|FINE|E0|Thread-4|2024-04-23 16:23:08.709 CST|SSLSocketOutputRecord.java:71|WRITE: TLCPv1.1 alert(close_notify), length = 10
com.tencent.kona.ssl|FINE|10|Test worker|2024-04-23 16:23:08.709 CST|SSLSocketOutputRecord.java:71|WRITE: TLCPv1.1 alert(close_notify), length = 10
嗯嗯,看起来是的。请问连接一下就断开,可能是什么原因
作为测试程序,握手成功就可以退出了。不然,程序不能结束。
嗯嗯谢谢。请问怎么可以不退出,我们目前无法正常发送数据。不使用tlcp时,程序可以正常发送和接收数据,如项目内的NettyDemo.java;使用tlcp后,无法发送数据了
修改TLCPWithNettyDemo$ClientHandler
类,
public void channelActive(ChannelHandlerContext ctx) {
ctx.writeAndFlush("Client request\n");
}
之前它有一个addListener(ChannelFutureListener.CLOSE)
。
收到
如果这个问题已经解决了,请关闭它。 若有新的问题,欢迎新开issue。
P.S. 如想支持该项目,请为它加星 ;-)
嗯嗯解决了,谢谢
我使用项目内的TLCPWithNettyDemo ,报错: "io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record"
环境:
java version "21.0.2" 2024-01-16 LTS Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58) Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing) kona: 1.0.12 netty: 4.1.63.Final
项目地址
https://github.com/meteor199/issue-kona-ssl
错误堆栈