I am trying to connect to a server with FluentFTP.GnuTLS.
Connection immediately works with FileZilla and it says the server speaks:
Protocol: TLS1.3, Key exchange: ECDHE-SECP256R1-RSA-PSS-RSAE-SHA384, Cipher: AES-256-GCM, MAC: AEAD, ALPN: ftp.
How do I configure for this?, I Got:
public bool Upload(string fileID, bool ignoreCert)
{
var client = new FtpClient(host, user, pass);
client.Config.CustomStream = typeof(GnuTlsStream);
client.Config.CustomStreamConfig = new GnuConfig()
{
SecuritySuite = GnuSuite.Normal,
SecurityOptions = new List<GnuOption> {
new GnuOption(GnuOperator.Exclude, GnuCommand.Protocol_All),
new GnuOption(GnuOperator.Include, GnuCommand.Protocol_Tls13),
new GnuOption(GnuOperator.Include, GnuCommand.KeyExchange_Ecdhe_Rsa),
new GnuOption(GnuOperator.Include, GnuCommand.Cipher_Aes_256_Gcm),
},
SecurityProfile = GnuProfile.None,
};
client.Config.EncryptionMode = FtpEncryptionMode.Explicit;
client.Config.DataConnectionType = FtpDataConnectionType.PASV;
client.Config.LogToConsole = true;
client.Config.DisconnectWithQuit = true;
try
{
client.Connect();
if (client.IsConnected)
{
Console.WriteLine("connected to FTP");
}
client.UploadFile(fileID + ".ics", fileID + ".ics", FtpRemoteExists.Overwrite, false, FtpVerify.Retry);
if (client.FileExists(fileID + ".ics"))
{
return true;
}
else
{
return false;
}
}
catch (Exception e)
{
Console.WriteLine("error");
File.AppendAllText("logfile.txt", DateTime.Now.ToString() + " Upload error upload: " + e.ToString() + "n");
return false;
}
finally
{
client.Disconnect();
client.Dispose();
}
}
I got the error:
Status: GnuTLS: 0 Debug : 5 Internal: REC[0x555937dd32d0]: Alert[2|120] - Es konnte kein unterstütztes Anwendungsprotokoll ausgehandelt werden - was received
which translates to: could not find any supported protocol.
this was also the case with all options set to auto.
could it be that there is a unsupported combination of protocols used by this server?
ni720 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.