ftp_ssl_connect 能否通过 TLS 处理隐式 FTP?默认情况下它使用显式.
Can ftp_ssl_connect handle Implicit FTP over TLS? By default it uses explicit.
我正在尝试上传到仅接受通过 tls 在端口 990 上的隐式 ftp 的服务器;有没有人遇到过这个?你是怎么解决的?
I'm trying to upload to a server that accepts only Implicit ftp over tls on port 990; has anybody run into this as of yet? How did you fix it?
ftp_ssl_connect 只是显式的
ftp_ssl_connect is only explicit
如果你需要隐式,使用 curl
if you need implicit, use curl
$fp = fopen($path, 'r');
$ftp_server = 'ftps://'.$server.'/'.$filename;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ftp_server);
curl_setopt($ch, CURLOPT_USERPWD,$user.':'.$pass);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_FTP_SSL, CURLFTPSSL_TRY);
curl_setopt($ch, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS);
curl_setopt($ch, CURLOPT_UPLOAD, 1);
curl_setopt($ch, CURLOPT_INFILE, $fp);
$output = curl_exec($ch);
$error_no = curl_errno($ch);
//var_dump(curl_error($ch));
curl_close($ch);
这篇关于ftp_ssl_connect 与 tls 上的隐式 ftp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!