private void OnServerConnectionAvailable(object sender, SecureConnectionResults args) { try { if (args.AsyncException != null) { _Log.ErrorFormat("Client connection failed {0}", args.AsyncException); return; } SslInfo sslInfo = args.SecureInfo; Session session = SessionMapping.Get(); Client client = new Client(sslInfo.SslStream, session, sslInfo.NetworkStream.BufferInUsed, sslInfo.Socket); SenderReceiverPair relation = new SenderReceiverPair(client, new ReceiveAgent()); Application.Default.AgentController.Add(session, relation.Receiver, relation.Sender); } catch (Exception ex) { _Log.Error(ex); } }
private static void WriteSslStatus(FTPSClient client) { if (options.verbose) { string sslSupportDesc = null; if ((client.SslSupportCurrentMode & ESSLSupportMode.CredentialsRequested) == ESSLSupportMode.CredentialsRequested) { sslSupportDesc = "Credentials"; } if ((client.SslSupportCurrentMode & ESSLSupportMode.ControlChannelRequested) == ESSLSupportMode.ControlChannelRequested) { sslSupportDesc += ", Commands"; } if ((client.SslSupportCurrentMode & ESSLSupportMode.DataChannelRequested) == ESSLSupportMode.DataChannelRequested) { if (sslSupportDesc != null) { sslSupportDesc += ", "; } sslSupportDesc += "Data"; } if (sslSupportDesc == null) { sslSupportDesc = "None"; } Console.WriteLine(); Console.WriteLine("SSL/TLS support: " + sslSupportDesc); SslInfo sslInfo = client.SslInfo; if (sslInfo != null) { Console.WriteLine("SSL/TLS Info: " + sslInfo.ToString()); } } }