Соединение с FileZilla сразу работает и пишет, что сервер говорит:
Протокол: TLS1.3, обмен ключами: ECDHE-SECP256R1-RSA -PSS-RSAE-SHA384, шифр: AES-256-GCM, MAC: AEAD, ALPN: ftp.
Как мне это настроить? Получил:
Код: Выделить всё
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 {
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();
}
}
Код: Выделить всё
Status: GnuTLS: 0 Debug : 5 Internal: REC[0x555937dd32d0]: Alert[2|120] - Es konnte kein unterstütztes Anwendungsprotokoll ausgehandelt werden - was received
Это также имело место, когда для всех параметров установлено значение «авто».
Могло ли быть такое на этом сервере используется неподдерживаемая комбинация протоколов?
Подробнее здесь: https://stackoverflow.com/questions/787 ... r1-rsa-pss