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

Advertisement

eriock
Joined:
Posts:
2

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);
}
}
}

Reply with quote

Advertisement

eriock
Joined:
Posts:
2

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!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,262
Location:
Prague, Czechia

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

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

Reply with quote

Advertisement

You can post new topics in this forum