Hi,
I used this code like in your reference and get this error, using core NuGet packages, what do I miss ?
Code
=====
private void Connect()
{
using (Ftp client = new Ftp())
{
//Set the licence Key
ComponentPro.Licensing.Common.LicenseManager.SetLicenseKey(FtpsLicenseKey);
//Connect to the FTP server.
if (FtpsPort == 21)
{
client.Connect(FtpsServerName, FtpsPort, SslSecurityMode.Explicit);
}
else
{
client.Connect(FtpsServerName, FtpsPort, SslSecurityMode.Implicit);// Exception throw here ?
}
// Authenticate.
client.Authenticate(FtpsUserName, FtpsPassword);
}
}
Error:
======
ComponentPro.Net.TlsException
HResult=0x80131500
Message=Connection was closed by the remote connection end.
Source=ComponentPro.Ftp.NetCore
StackTrace:
at ComponentPro.Net.Ftp.c_d8db87dc(String , Int32 , SslConfigBase , SslSecurityMode , FtpSslExplicitAuthType , AsyncOperation )
at ComponentPro.Net.Ftp.Connect(String serverName, Int32 serverPort, SslSecurityMode security)
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
TlsException: Connection was closed by the remote connection end.
Inner Exception 2:
TlsException: Connection was closed by the remote connection end.
answered 6/20/2022 9:34:04 AM