I'm trying to send a file to a ftp server using ftps in C#. I am using filezilla server to test locally. I already tried using just regular ftp (without EnableSsl) and it works fine. I've already looked around and I'm trying to set up the certificates, but I can't get it to work. I keep getting error: the remote certificate is invalid according to the validation procedure. On filezilla, I used their "generate certificate" in the settings and saved it to desktop. So what is the file I need to use to create certificate from? Is it the one filezilla generated? If so, its a .crt file, so I wasn't able to use the CreateFromCertFile() method..
This is where I add the certificate
X509Certificate cert = X509Certificate.CreateFromCertFile(pathtofile);
X509CertificateCollection certCollection = new X509CertificateCollection();
certCollection.Add(cert);
request.ClientCertificates.Add(cert);
I have the ftp request like this
var request = (FtpWebRequest) WebRequest.Create(fullPath);
request.UseBinary = true;
request.Method = WebRequestMethods.Ftp.UploadFile;
request.EnableSsl = true;
request.KeepAlive = false;
request.Credentials = new NetworkCredential(username, password);
request.UsePassive = true;
Thanks in advance