简体   繁体   中英

Getting “Authentication via SSL not supported.” when calling PHP function ftp_login

I'm having issues with connecting to remote ftp server with PHP and SSL. I am using ftp_ssl_connect to at least connect to remote FTP server with SSL, but with no luck.

I'm getting

ftp_login(): Authentication via SSL not supported.

I'm using these PHP lines.

$ftp_conn = ftp_ssl_connect($host);
$login_result = ftp_login($ftp_conn, $user, $pw);

Indeed SSL is not supported for both (local, remote) machines. I have checked it with php -i | grep "SSL Version" php -i | grep "SSL Version" and it returns Secure Transport. I think this is the problem. I would like to change it to OpenSSL but without reinstalling PHP as it was mentioned in other Stack Overflow questions. Is it possible?

Thanks for reply.

Indeed SSL is not supported for both (local, remote) machines

If the server does not support TLS/SSL, there's nothing you can do about it on client (PHP) side.


And indeed the "Authentication via SSL not supported" seems to be an error message coming from the (tnftpd) FTP server:
https://discussions.apple.com/thread/7045410


Actually I do not think that you have a problem on client (PHP) side. Because were OpenSSL not built into PHP, your PHP script won't even run, as the ftp_ssl_connect function won't be available.

You would get:

Call to undefined function ftp_ssl_connect() in ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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