Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0.0-M2
-
None
-
None
Description
Checking if the data and control sockets are secure (running over SSL/TLS) from a Ftplet is quite intricate and depends on knowledge of the internal implementation in FtpServer. We should make this simple. Suggestion by Jeroen Cranendonk
I've cobbled together some code which should give an idea of what I'm trying
to achieve, haven't tested it yet though. And I do realize this probably
breaks your design in all kinds of ways
Firstly, I've added the following to FtpSessionImpl:
public boolean isDataConnectionSecure()
public boolean isSecure()
{ return ioSession.getFilterChain().contains("sslSessionFilter"); }public void write(final Object message)
{ ioSession.write(message); }And then my Ftplet looks like this (and it probably won't compile unless
it's against the full ftpserver code):
public class MyFtplet extends DefaultFtplet implements Ftplet {
@Override
public FtpletEnum onUploadStart(final FtpSession session, final
FtpRequest request) throws FtpException,
IOException
private FtpletEnum onLimitedStart(final FtpSession session, final
FtpRequest request)
session.write(new
DefaultFtpReply(FtpReply.REPLY_550_REQUESTED_ACTION_NOT_TAKEN,
"Cannot do this before securing the connection."));
return FtpletEnum.RET_SKIP;
}
}
Attachments
Issue Links
- is cloned by
-
FTPSERVER-150 CLONE -Provide convenience methods for checking is the control and data sockets are secure
- Closed
- is duplicated by
-
FTPSERVER-150 CLONE -Provide convenience methods for checking is the control and data sockets are secure
- Closed