Chinaunix

标题: pureftpd+tls,失败? [打印本页]

作者: norman_lu    时间: 2005-12-28 20:21
标题: pureftpd+tls,失败?
internet上一台freebsd 6.0+pf
pureftpd安装一切都正常,用smartftp,passive和active都能正常登陆,使用,就是TLS不能登陆,错误信息是
代码:
220 You will be disconnected after 15 minutes of inactivity.
    AUTH TLS
234 AUTH TLS OK.
    Connected. Exchanging encryption keys...
    Server closed connection
    Cannot login waiting to retry (30s)...

然后就一直重试

内网一台同样的freebsd 6.0+pf,pureftpd+tls设置也一样,smartftp能正常登陆
代码:
    AUTH TLS
234 AUTH TLS OK.
    Connected. Exchanging encryption keys...
    Session Cipher: 128 bit RC4
    TLS encrypted session established.
作者: wolfg    时间: 2005-12-29 13:53
pureftpd的log里有什么信息?
作者: cxu123    时间: 2005-12-29 14:07
没有创建X.509证书,或者证书有问题
作者: norman_lu    时间: 2005-12-29 19:50
log里面的信息和官方上的FAQ是一样的,但是也没有好的解决方案。

* TLS and error 00000000.

-> My TLS-enabled client doesn't work. It outputs something like :
"SSL connect: error:00000000:lib(0):func(0):reason(0)". What does it mean?

This error is not very explicit. You get it from some Unix clients like LFTP.
It actually means that there is a firewall or a NAT box between a TLS-enabled
server and a TLS-enabled client, but that firewall is unable to handle
encrypted FTP sessions. Unfortunately, there's no simple workaround against
this. Try to switch your client to active mode and use 1:1 NAT, but SSL/TLS,
firewalls and FTP don't mix very well.
作者: cxu123    时间: 2005-12-30 10:56
原帖由 norman_lu 于 2005-12-29 19:50 发表
log里面的信息和官方上的FAQ是一样的,但是也没有好的解决方案。

* TLS and error 00000000.

-> My TLS-enabled client doesn't work. It outputs something like :
"SSL connect: error:00000000 ...

和你的情况不同,你在TLS的协商阶段就出问题,肯定证书有问题。FAQ说的是TLS Encryption通道建立后,FTP的PASV或PORT命令出问题的情况。

如果FAQ指的是TLS连接和协商阶段,那肯定是Pureftp的开发人员在扯淡。感觉Pureftp的开发人员不怎么懂SSL协议,连FTP数据传输的SSL,TLS加密,这么基本的功能都不提供。Pureftp的SSL纯粹是漏勺,只是FTP控制链路加密了。

[ 本帖最后由 cxu123 于 2005-12-30 11:01 编辑 ]
作者: norman_lu    时间: 2005-12-30 11:53
证书肯定没问题,因为把这个证书放到内网的这个机器,或者把内网机器的证书拷到internet机器上,都做过试验了。试验的结果就是,内网始终都是可以,internet始终都不行,错误信息就是"SSL connect: error:00000000:lib(0):func(0):reason(0)"。
还有,我不觉得pureftpd不支持数据加密传输有什么不好,我需要的只是在帐户验证过程中的加密,对于数据传输,我要的是速度,因为没有什么机密的数据,对我来说,已经足够了。
作者: wolfg    时间: 2005-12-30 14:22
It actually means that there is a firewall or a NAT box between a TLS-enabled
server and a TLS-enabled client, but that firewall is unable to handle
encrypted FTP sessions.

这句没有用处吗?
作者: norman_lu    时间: 2005-12-30 15:59
原帖由 wolfg 于 2005-12-30 14:22 发表
It actually means that there is a firewall or a NAT box between a TLS-enabled
server and a TLS-enabled client, but that firewall is unable to handle
encrypted FTP sessions.
...

检查过pf了,没找到有解决方案。因为passive和active模式工作都正常,也就是该开的端口都开了,不知道pf还有什么可以设置的。
作者: wolfg    时间: 2005-12-30 16:06
http://projects.standblue.net/ma ... ureftpd&ID=4699
这个有帮助没有?
作者: cxu123    时间: 2005-12-31 09:59
明显是SSL handshake的问题。

第一件事情是升级服务器的Openssl到最新版本,用FlashFXP的TLS试验,FlashFXP也是用Openssl。

如果不能连,可以用Vsftpd的TLS试验一下,感觉vsftpd的代码质量好过pureftpd。

如果防火墙在中间捣乱,Stateful的防火墙,对FTP可能只Parse 21端口。如果可能,将服务器端口不用21,试验一次。或将服务器放到DMZ里
作者: norman_lu    时间: 2005-12-31 16:00
Flashfxp已经试过了,结果是一样的。晚上回去改端口再试试,这里多谢两位啦,由于vsftpd没有我要的功能,因此暂时不会换了。
作者: norman_lu    时间: 2006-01-03 18:36
非常感谢,换了一个端口就ok啦。
作者: norman_lu    时间: 2006-01-04 11:00
我觉得这个问题可能是ftp代理的问题,因为pf对于在nat后面的ftp client是用ftp-proxy代理方式出去的。比如pf在内网网卡监听21端口,然后把内网的21端口请求转发到8021,最后再nat出去。当ftp服务器换了一个端口后,比如2121,pf直接就把内网对2121端口的包nat出去了,不经过ftp-proxy,所以TLS可以正常工作。个人见解,还请各位指教。

[ 本帖最后由 norman_lu 于 2006-1-4 11:06 编辑 ]
作者: cxu123    时间: 2006-01-05 16:29
原帖由 norman_lu 于 2006-1-4 11:00 发表
我觉得这个问题可能是ftp代理的问题,因为pf对于在nat后面的ftp client是用ftp-proxy代理方式出去的。比如pf在内网网卡监听21端口,然后把内网的21端口请求转发到8021,最后再nat出去。当ftp服务器换了一个端口后 ...

不知道了,不过pureftpd不支持Implicit SSL,否则就简单了,也可以直接用21端口。既然开FTP就不用pf,普通的硬件防火墙大概没有那么傻?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2