对于一个项目,我们需要通过SSL (ftps)与FTP服务器通信
我编写了以下代码:
var ftpRequest = (FtpWebRequest)WebRequest.Create(ftpServer);
ftpRequest.EnableSsl = true;
ftpRequest.Credentials = new NetworkCredential(username, password);
ftpRequest.Method = WebRequestMethods.Ftp.ListDirectory;
var response = (FtpWebResponse)ftpRequest.GetResponse();
var streamReader = new StreamReader(response.GetResponseStream());
var directories = new List<string>();在执行该示例时,我得到以下异常。
使用代理时无法启用SSL。
在我们公司,我们的防火墙是代理,但这不应该避免通信,因为例如,通过windows资源管理器,我可以连接到服务器。
我能做什么?
发布于 2018-07-24 06:47:40
不可能通过代理使用TLS/SSL进行连接。看起来你的问题是与这个Connect to FTPS with proxy in C#重复的,这个问题已经被回答了。
希望它能帮上忙
https://stackoverflow.com/questions/51491825
复制相似问题