Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: ERROR: Peer certificate rejected | How do i accept the certificate ?

OK, I hope you did notice the GiveUpSecurity... and understand the consequences.
eriock

Re: ERROR: Peer certificate rejected | How do i accept the certificate ?

Thanks Martin but this GiveUpSecurityAndAcceptAnyTlsHostCertificate = true,
did it for me its working now thanks!
eriock

ERROR: Peer certificate rejected | How do i accept the certificate ?

I've just begun using WinSCP today i've successfully connected from WinSCP GUI now I'm trying to automate things using C# .net and now I'm stuck with this Error:

private void button1_Click(object sender, System.EventArgs e)
{
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = "1.2.3.4",
PortNumber = 990,
UserName = "username",
Password = "password",
FtpSecure = FtpSecure.Implicit,
};
using (Session session = new Session())
{
session.Open(sessionOptions);
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
TransferOperationResult transferResult;
transferResult =
session.GetFiles("/BackupLogs/*", @"C:\InternalShortcuts\BackupLogs\", false, transferOptions);
transferResult.Check();
foreach (TransferEventArgs transfer in transferResult.Transfers)
{
Console.WriteLine("Download of {0} succeeded", transfer.FileName);
}
}
}