我想用下面的代码获得FTPS的FileZilla服务器的目录列表:底层连接已关闭。服务器犯了违反协议
ftpRequest = (FtpWebRequest)FtpWebRequest.Create(host + "/" + directory);
ftpRequest.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateCertificate);
ftpRequest.Credentials = new NetworkCredential(user, pass);
ftpRequest.UseBinary = true;
ftpRequest.UsePassive = true;
ftpRequest.KeepAlive = true;
ftpRequest.Method = WebRequestMethods.Ftp.ListDirectory;
ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();
我得到了一个异常时,FtpWebResponse)ftpRequest.GetResponse()
执行:
底层连接被关闭。服务器承诺违反协议 。
当我切换到正常的FTP连接。一切工作正常。
我错过了什么来建立这个FTPS连接? 感谢您的帮助
你有权访问Filezilla服务器吗?你确定证书是有效的吗?你配置它正确使用**明确的FTPS ** – 2014-10-09 12:52:05
是的我有权访问服务器。证书也是有效的,并且显式的FTPS被检查。我正在使用引用隐式SSL/TLS连接的端口990。它是否支持FtpWebRequest? – MadNeox 2014-10-09 13:04:27