1 客户端报错日志
java客户端日志显示复制流管道突然被断开,流复制过程被中断,这种情况下再看客户端日志也看不出什么苗头,我们可以从服务端日志下手。
2 服务端日志
首先看proftpd.log日志:
2023-01-06 11:11:32,818 gds proftpd[93656] gds (192.188.40.10[192.188.40.10]): FTP session opened.
2023-01-06 11:11:32,839 gds proftpd[93656] gds (192.188.40.10[192.188.40.10]): mod_cap/1.1: cap_set_proc failed: 不允许的操作
2023-01-06 11:11:32,839 gds proftpd[93656] gds (192.188.40.10[192.188.40.10]): mod_cap/1.1: attempt to configure capabilities failed, reverting to normal operation
2023-01-06 11:11:32,839 gds proftpd[93656] gds (192.188.40.10[192.188.40.10]): USER ftpsuser: Login successful.
日志显示:FTP session开启之后,有一个cap_set_proc函数执行报错,但是随后用户ftpsuser登录成功,也没有其他日志有助于定位问题,这个时候我们可以看一下proftpd其他日志错误打印信息。如tls.log。
tls.log日志如下:
2022-11-04 17:44:02,432 mod_tls/2.6[28929]: TLSv1/SSLv3 connection accepted, using cipher ECDHE-RSA-AES128-SHA256 (128 bits)
2022-11-04 17:44:02,440 mod_tls/2.6[28929]: Protection set to Private
2022-11-04 17:44:02,444 mod_tls/2.6[28929]: starting TLS negotiation on data connection
2022-11-04 17:44:02,654 mod_tls/2.6[28929]: client did not reuse SSL session, rejecting data connection (see the NoSessionReuseRequired TLSOptions parameter)
2022-11-04 17:44:02,654 mod_tls/2.6[28929]: unable to open data connection: TLS negotiation failed
日志打印显示:client did not reuse SSL session, rejecting data connection (see the NoSessionReuseRequired TLSOptions parameter),简单理解就是客户端没有重用SSL session,拒绝数据连接。解决办法很简单,在proftpd.conf配置中加入TLSOptions选项,取值为NoSessionReuseRequired,就能解决问题。
现在我们来探究一下为什么会出现这种错误,mod_tls是proftpd中一个模块,当mod_tls开启之后,默认要求客户端重用SSL Session,但是当客户端不能重用SSL Session(版本原因或其他),这个时候我们需要在服务端停止重用SSL Session校验,所以服务端配置TLSOptions NoSessionReuseRequired就能解决这个问题。
最后,附上TLSOptions官网选项,ProFTPD module mod_tls