diff --git a/samples/TestFtpServer/FtpOptionsExtensions.cs b/samples/TestFtpServer/FtpOptionsExtensions.cs index 9ed92717..e9b0f405 100644 --- a/samples/TestFtpServer/FtpOptionsExtensions.cs +++ b/samples/TestFtpServer/FtpOptionsExtensions.cs @@ -95,7 +95,7 @@ public static (int from, int to)? GetPasvPortRange(this FtpOptions options) return null; } - var cert = new X509Certificate2(options.Ftps.Certificate); + var cert = new X509Certificate2(options.Ftps.Certificate, options.Ftps.Password); if (cert.HasPrivateKey) { return cert; diff --git a/samples/TestFtpServer/OptionsConfigSource.cs b/samples/TestFtpServer/OptionsConfigSource.cs index 3a4cd792..1a17cdb2 100644 --- a/samples/TestFtpServer/OptionsConfigSource.cs +++ b/samples/TestFtpServer/OptionsConfigSource.cs @@ -81,7 +81,7 @@ public IConfigurationProvider Build(IConfigurationBuilder builder) { "c|certificate=", "Set the SSL certificate", v => values["ftps:certificate"] = v }, { "k|private-key=", "Set the private key file for the SSL certificate", v => values["ftps:privateKey"] = v }, { "P|password=", "Password for the SSL certificate", v => values["ftps:password"] = v }, - { "i|implicit", "Use implicit FTPS", v => values["ftps:implicit"] = XmlConvert.ToBoolean(v.ToLowerInvariant()) ? "true" : "false" }, + { "i|implicit", "Use implicit FTPS", v => values["ftps:implicit"] = "true" }, "Backends", new Command("system-io", "Use the System.IO file system access") { diff --git a/src/FubarDev.FtpServer/FtpConnection.cs b/src/FubarDev.FtpServer/FtpConnection.cs index f7daea0c..d86f6ac4 100644 --- a/src/FubarDev.FtpServer/FtpConnection.cs +++ b/src/FubarDev.FtpServer/FtpConnection.cs @@ -228,6 +228,7 @@ public FtpConnection( parentFeatures.Set(_keepAlive); #pragma warning restore 612 #pragma warning restore 618 + parentFeatures.Set(new ServiceProvidersFeature(ConnectionServices)); var features = new FeatureCollection(parentFeatures); #pragma warning disable 618