ftp_login() : SSL/TLS handshake failed

£可爱£侵袭症+ 提交于 2020-01-24 01:50:07

问题


I have to retrieve a file by using FTPS :

$ftp = ftp_ssl_connect($ftp_server, 9921, 10);

$bool = ftp_login($ftp, $login, $pass);

ftp_pasv($ftp, true);

$files = ftp_nlist($ftp, "/");

var_dump($files);
die();

But I have this warnings, and $files is false

Warning: ftp_login() [function.ftp-login]: SSL/TLS handshake failed in xxx\view.importfromadmin.php on line 81

Warning: ftp_login() [function.ftp-login]: Using authentication type TLS in xxx\view.importfromadmin.php on line 81

How can I fixe it ?


回答1:


I can copy my file using this :

$ftp_path = "ftps://$ftp_login:$ftp_password@$ftp_server:9921/".$import_file;

copy($ftp_path, $uploadFileName);



回答2:


I think your issue is going to lay with OpenSSL not being compiled with PHP. You can find more information about that here: http://www.deciacco.com/blog/php/php-openssl-and-ftp_ssl_connect-on-win32

With information on how to fix it as well. You can check if your PHP has OpenSSL compiled through the phpinfo. Given that you are running a Windows server check the link above. Since you did not provide that information this is just a random guess.



来源:https://stackoverflow.com/questions/5553681/ftp-login-ssl-tls-handshake-failed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!