aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Integrations
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-09-20 20:13:05 -0500
committerGitHub <noreply@github.com>2022-09-20 20:13:05 -0500
commitc4544a6a14577a79d02d009f38557cbcf9ec80ad (patch)
tree69ae056823d2d5d050e2c80ff45b1ffa2126c1b4 /src/slskd/Integrations
parent2a1a7aca5f7a6fa70652135f7a7034bef55dfed4 (diff)
parent6a307269ab99956fb2c5ea2149ae76c3ef24c8b2 (diff)
downloadslskd-c4544a6a14577a79d02d009f38557cbcf9ec80ad.tar.gz
Merge branch 'master' into aux/docs-proofreading
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