Aug 4, 2009 at 9:09 PM


I was able to connect to a SFTP site with command line.  Now I'm trying to use class library. I've used different parameters for FTPSClient.Connect but keep getting error. What's parameters should I use?

Command line: ftps -h mySiteUri -ssl Implicit -U myUser -l /inbox/

Error when using class library:  {"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"}

Appreciate for any suggestions.



Aug 4, 2009 at 9:25 PM


After using Implicit, I seems connect to the FTP site but I got the error at Client.Connect().

"The remote certificate is invalid according to the validation procedure."

I got the same message in command line, but I was able to type Y.

I used the sample code provided in home page.



Aug 4, 2009 at 9:55 PM
Edited Aug 4, 2009 at 9:55 PM


to unconditionally accept invalid server certificates just implement a RemoteCertificateValidationCallback delegate and pass it to the Connect method as in the following code snippet:

private static bool ValidateTestServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
     // Accept any certificate
     return true;

client.Connect(..., new RemoteCertificateValidationCallback(ValidateTestServerCertificate), ...);

You might also add some more complex logic, based on your needs. The certificate, chain and sslPolicyErrors parameters provide the necessary context.



Aug 5, 2009 at 7:13 PM

Hi Alex,

Thanks for the suggestion and it works.


May 25, 2012 at 6:01 PM

No matter what I try, still get a handshake error.  Any idea, anyone?  I also setup my code so it accepts ANY certificate.  I even downloaded the source code and tried to run it from Visual Studio.  The command project that the source has attached also gives me the same handshake error.