Exemplo n.º 1
0
 /// <summary>Initializes a new instance of the <see cref="Storage" /> class.</summary>
 /// <param name="connectionString">ConnectionString of the storage.</param>
 /// <param name="flags">The connection flags.</param>
 protected Storage(ConnectionString connectionString, ConnectionFlags flags)
 {
     ConnectionString       = connectionString;
     AllowUnsafeConnections = flags.HasFlag(ConnectionFlags.AllowUnsafeConnections);
     LogVerboseMessages     = flags.HasFlag(ConnectionFlags.VerboseLogging);
     if (LogVerboseMessages)
     {
         Trace.TraceInformation("Verbose logging <green>enabled!");
     }
 }
Exemplo n.º 2
0
        public async Task OnDataChannelEncryptionDisabled()
        {
            ClientDataConnection.DisableEncryption();

            ActionsTracker.ConnectionSecurityChanged(null, new ConnectionSecurityChangedEventArgs()
            {
                EndPoint = ClientInitialRemoteEndPoint,
                Security = ConnectionFlags.HasFlag(ControlConnectionFlags.UsingTLSorSSL)
                ? ConnectionSecurity.ControlConnectionSecured
                : ConnectionSecurity.NonSecure
            });
        }
Exemplo n.º 3
0
        public async Task OnDataChannelEncryptionEnabled()
        {
            if (!IsEncryptionSupported)
            {
                SendResponse(new FtpReply()
                {
                    ReplyCode = FtpReplyCode.NotImplemented, Message = "Server is not configured to support SSL/TLS."
                }, false);
                return;
            }

            ClientDataConnection.ActivateEncryption();

            ActionsTracker.ConnectionSecurityChanged(null, new ConnectionSecurityChangedEventArgs()
            {
                EndPoint = ClientInitialRemoteEndPoint,
                Security = ConnectionFlags.HasFlag(ControlConnectionFlags.UsingTLSorSSL)
                ? ConnectionSecurity.Both
                : ConnectionSecurity.DataChannelSecured
            });

            Logger.Log($"Enabled encryption for datachannel : {ClientInitialRemoteEndPoint.ToString()}"
                       , RecordKind.Status);
        }