0 votes

Good morning,
im trying to connect to ftp server but ConnectSSL throw this exception:

Additional information: Authenticate as SSL client failed. You might be connecting to non SSL port.

i can connect using filezilla but cant with this code:

using (Ftp client = new Ftp())
{
     client.Mode = FtpMode.Passive;
     client.ServerCertificateValidate += ValidateCertificate;
     client.ConnectSSL(ftpUrl, puerto);
     client.Login(username, password);

     foreach (FtpItem item in client.GetList())
     {
         if (item.IsFolder == true)
              Console.WriteLine("[{0}]", item.Name);
         else
              Console.WriteLine("{0}", item.Name);
     }
     client.Close();
}

I cant see the problem. Can you help me?

Thank you very much

by (600 points)

2 Answers

0 votes
 
Best answer

Most likely you are using incorrect port.

To use default value (990) simply skip this parameter:

client.ConnectSSL(ftpUrl);
by (276k points)
selected by
0 votes

i need to connect to specific port (22222) i cant use default port

thank you very much

by (600 points)
im still getting the same error :(
Use
   client.ConnectSSL(ftpUrl, port);
-or-
   client.Connect(ftpUrl, port);
...