FTP OVER SSL - Invalid Token Error

Posted by crazsmith on Stack Overflow See other posts from Stack Overflow or by crazsmith
Published on 2010-05-13T22:21:02Z Indexed on 2010/05/13 22:24 UTC
Read the original article Hit count: 581

Filed under:
|

I am trying to implement FTP over SSL to upload encrypted files. I've created a SSL certificate and send it to the vendor. But I couldn't make a FTPS connection to the server. When connecting via FTPS, I'm authenticating using my private key file.

I have tried .NET FTPWebRequest, SmartFTp,CuteFTP Pro.

I am getting the following error:-

A call to SSPI failed. See inner exception.

The inner exception is "The token supplied to the function is invalid"

        FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create("ftp://RemoteHost.Com");
        request.Credentials = new NetworkCredential("UserName", "Password");
        request.KeepAlive = false;
        request.EnableSsl = true;
        X509Certificate2 cert2 = new X509Certificate2("PrivateKeyFile.pfx", "password");             
        request.ClientCertificates.Add(cert2);               
        FtpWebResponse response = (FtpWebResponse)request.GetResponse();

Any Help Appreciated.

Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ftps