private static IFtpServerBuilder ConfigureServer(this IFtpServerBuilder builder, FtpOptions options)
        {
            builder = builder
                      .DisableChecks();

            if (options.Connection.Inactivity.Enabled)
            {
                builder = builder
                          .EnableIdleCheck();
                builder.Services
                .Configure <FtpConnectionOptions>(
                    opt => opt.InactivityTimeout = ToTimeSpan(options.Connection.Inactivity.InactivityTimeout));
            }

            if (options.Connection.SocketState.Enabled)
            {
                builder = builder
                          .EnableConnectionCheck();
            }

            if (options.Ftps.Implicit)
            {
                var implicitFtpsCertificate = options.GetCertificate();
                if (implicitFtpsCertificate != null)
                {
                    builder = builder.UseImplicitTls(implicitFtpsCertificate);
                }
            }

            return(builder);
        }
Beispiel #2
0
        private static IFtpServerBuilder ConfigureServer(this IFtpServerBuilder builder, FtpOptions options)
        {
            builder = builder
                      .DisableChecks();

            if (options.Connection.Inactivity.Enabled)
            {
                builder = builder
                          .EnableIdleCheck();
                builder.Services
                .Configure <FtpConnectionOptions>(
                    opt => opt.InactivityTimeout = ToTimeSpan(options.Connection.Inactivity.InactivityTimeout));
            }

            if (options.Connection.SocketState.Enabled)
            {
                builder = builder
                          .EnableConnectionCheck();
            }

            return(builder);
        }