Add protection only when necessary
This commit is contained in:
@@ -9,14 +9,22 @@
|
||||
|
||||
public void Execute(Session session, FtpStream stream, string alias, string argument)
|
||||
{
|
||||
var dataConnection = session.DataConnection;
|
||||
|
||||
switch (argument.ToUpper())
|
||||
{
|
||||
case "C":
|
||||
session.DataConnection.DesactivateTls();
|
||||
if (dataConnection.IsTlsProtected)
|
||||
{
|
||||
session.DataConnection.DesactivateTls();
|
||||
}
|
||||
stream.Send(ResponseCode.OK, "Data protection cleared.");
|
||||
break;
|
||||
case "P":
|
||||
session.DataConnection.ActivateTls();
|
||||
if (!dataConnection.IsTlsProtected)
|
||||
{
|
||||
session.DataConnection.ActivateTls();
|
||||
}
|
||||
stream.Send(ResponseCode.OK, "Data protection set.");
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user