简体   繁体   English

ftp_login():SSL / TLS握手失败

[英]ftp_login() : SSL/TLS handshake failed

I have to retrieve a file by using FTPS : 我必须使用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 但是我有这个警告, $filesfalse

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 ? 我该如何解决?

I can copy my file using this : 我可以使用以下命令复制文件:

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

copy($ftp_path, $uploadFileName);

I think your issue is going to lay with OpenSSL not being compiled with PHP. 我认为您的问题将在于无法使用PHP编译OpenSSL。 You can find more information about that here: http://www.deciacco.com/blog/php/php-openssl-and-ftp_ssl_connect-on-win32 您可以在此处找到有关此信息的更多信息: 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 . 您可以检查您的PHP是否通过phpinfo编译了OpenSSL。 Given that you are running a Windows server check the link above. 假设您正在运行Windows服务器,请检查上面的链接。 Since you did not provide that information this is just a random guess. 由于您没有提供该信息,因此这只是一个随机的猜测。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM