Hello all. I have spent a day long trying to figure out why I could not connect to a FTPS server but to no avail. I always got this error.
System.Security.Authentication.AuthenticationException
a call to SSPI failed, see inner exception
I set up a connection in FileZilla, with protocal=FTP and encription=any of the three TLS choices. It works well. I can download, upload and delete files in the server. But it just doesn't work with C# code.
Does anyone have any ideas ?
public bool CheckConnection(string RemoteHost, string UserName, string Password) { try { FtpWebRequest request = (FtpWebRequest)WebRequest.Create(RemoteHost); request.EnableSsl = true; request.Method = WebRequestMethods.Ftp.ListDirectory; request.Credentials = new NetworkCredential(UserName, Password); request.GetResponse(); } catch (WebException ex) { MessageBox.Show("Fail:" + ex.ToString()); return false; } return true; }