0

For a project, we need to communicate with an FTP Server over SSL (ftps)

I wrote the following code:

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>();

When executing the example I get the following exception.

SSL cannot be enabled when using a proxy.

At our company, we are behind a firewall a proxy, but that should not avoid the communication because e.g. over the windows explorer I can connect to the Server.

What can I do?

AustinWBryan
  • 3,249
  • 3
  • 24
  • 42
Sebastian Mehler
  • 418
  • 6
  • 15

1 Answers1

0

It is not possible to connect using TLS/SSL over proxy. Looks like your question is a duplicate to this one Connect to FTPS with proxy in C# which is already answered

Hope it helps

Tabby
  • 91
  • 1
  • 1
  • 10
  • If its a duplicate, its more common to flag the question as a duplicate. unless you are adding more information and content, just a heads up – TheGeneral Jul 24 '18 at 07:12