aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Integrations
diff options
context:
space:
mode:
Diffstat (limited to 'src/slskd/Integrations')
-rw-r--r--src/slskd/Integrations/FTP/FTPClientFactory.cs16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/slskd/Integrations/FTP/FTPClientFactory.cs b/src/slskd/Integrations/FTP/FTPClientFactory.cs
index 2e41ab03..70cfbc03 100644
--- a/src/slskd/Integrations/FTP/FTPClientFactory.cs
+++ b/src/slskd/Integrations/FTP/FTPClientFactory.cs
@@ -47,24 +47,10 @@ namespace slskd.Integrations.FTP
public FtpClient CreateFtpClient()
{
var client = new FtpClient(FtpOptions.Address, FtpOptions.Port, FtpOptions.Username, FtpOptions.Password);
- client.EncryptionMode = ParseFtpEncryptionMode(FtpOptions.EncryptionMode);
+ client.EncryptionMode = FtpOptions.EncryptionMode.ToEnum<FtpEncryptionMode>();
client.ValidateAnyCertificate = FtpOptions.IgnoreCertificateErrors;
return client;
}
-
- private FtpEncryptionMode ParseFtpEncryptionMode(string encryptionMode)
- {
- try
- {
- return (FtpEncryptionMode)Enum.Parse(typeof(FtpEncryptionMode), encryptionMode, ignoreCase: true);
- }
- catch (Exception ex)
- {
- // Options should validate that the given string is parsable to FtpEncryptionMode through EnumAttribute; if this
- // throws there's a bug somewhere.
- throw new ArgumentException($"Failed to parse {typeof(FtpEncryptionMode).Name} from application Options. This is most likely a programming error; please file a GitHub issue and include your FTP configuration.", ex);
- }
- }
}
} \ No newline at end of file