public class FtpsServer extends FtpServer implements FtpConstants
FtpServer
. It implements the FTPS protocol as defined
in Securing FTP with TLS specification,
which is based on RFC 2228, FTP Security Extensions.
FTPS protocol defines a mechanism for securing the control and data connections of a FTP session. FTPS uses SSL to provide a
confidential, and integrity protected channel. We support two flavors of FTPS. Implicit FTPS secures the channel on
connection. Explicit FTPS secures the connection when the client issues an AUTH command.
An Explicit FTPS connection starts out as a regular FTP connection. The connection is secure only after the client issues an AUTH command. Server Implementations are free to define their Security policy, which controls what a client can do before the channel is secure. At least for the initial release we have defined a very strict policy, that is not configurable.
Several aspects of the SSL Context are configurable. See SocketFactory
for details. Again, we will mostly use the defaults, and provide little or no configurability in the first release.
Architecturally, we have refactored the FtpServer to allow:
getServerSocketFactory method
that is called during establishing the Server Socket.
FtpsServer overrides this method to create an SSLServerSocket if needed.
ServerChannel
can be ovverriden by changing the
createChannel
method. FtpsServer, creates a FtpsServerChannel
.
This class changes the way Data Sockets are created, and enforces the Security policy of the Connection.
AUTH
,
PROT
, PBSZ
,
and CCC
.
IFS.SERVER.PROTOCOL.FTPS.SECURITY.IMPLICIT
which
controls whether the FtpsServer supports the Implcit or Explicit FTPS protocol. The default value is false.
Auth command
for details.
IfsServer.ServerRequest
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_IsSecurityImplicit
Controls whether connection is implicity secure(Implicit SSL) or is initiated by AUTH command.
|
protected SSLContext |
m_SSLContext |
m_AcceptQueueSize, m_AnonymousAllowed, m_BindAddress, m_Channels, m_ChannelSequence, m_CommandInvoker, m_ControlPort, m_ControlServerSocket, m_DefaultCommandCharacterSet, m_FtpResources, m_FtpSessions, m_HostAddress, m_HostName, m_Locale, m_LocaleCountry, m_LocaleLanguage, m_Localhost, m_MaximumConnections, m_Random, m_SessionTimeoutPeriod, m_Version
LEVEL_HIGH, LEVEL_LOW, LEVEL_MEDIUM, LEVEL_OFF
ACCEPT_QUEUE_SIZE, ACCESS_DENIED, ADMIN_COMMAND, ADMIN_OFF, ADMIN_ON, ANONYMOUS_ALLOWED, ANONYMOUS_USER_NOT_ALLOWED, ANONYMOUS_USERNAME, AUTH_COMMAND, BANNER_TEXT, CCC_COMMAND, CDUP_COMMAND, COMMAND_CHARACTER_SET_IS_USER_CHARACTER_SET, CWD_COMMAND, DATA_SOCKET_ERR, DEFAULT_COMMAND_CHARACTER_SET, DEFAULT_PORT, DELE_COMMAND, ERR_SETTING_SOCKET_ACTIVE, ERR_SETTING_SOCKET_PASV, ERR_SSL_SOCKETS, FILE_NOT_FOUND, FILE_RETR_FAIL, FILE_STOR_FAIL, FOLDER_FOUND, FOLDER_HAS_ITEMS, FOLDER_NOT_FOUND, FOLDERLINKS_EXIST, FTP_DESCRIPTIVE_NAME, FTP_NAME, FTP_STATUS, FTPS_NAME, HOST_ADDRESS, HOST_NAME, IMPLICIT_SECURITY, INVALID_ARGUMENT, LAST, LATIN_1, LIBRARY_VERSION, LINK_IS_BROKEN, LIST_COMMAND, LIST_FAIL, LN_COMMAND, LOCALE_COUNTRY, LOCALE_LANGUAGE, LOCALHOST, LOCALHOST_DEFAULT, LOGIN_FAILED, MAXIMUM_CONNECTIONS, MKD_COMMAND, NLST_COMMAND, NO_ERR, NOOP_COMMAND, NORMALIZE_PATH_ERR, NOT_DOCUMENT_TYPE, NOT_FOLDER_TYPE, NOT_LOGGED_IN, PASS_COMMAND, PASV_COMMAND, PBSZ_COMMAND, PORT, PORT_COMMAND, PROT_COMMAND, PWD_COMMAND, QUIT_COMMAND, REQ_DENIED_BY_POLICY, RETR_COMMAND, RMD_COMMAND, RNFR_COMMAND, RNTO_COMMAND, ROOT_FOLDER, SESSION_TIMEOUT_PERIOD, SETCHARACTERSET_COMMAND, SETCOMMANDCHARACTERSET_COMMAND, SETLANGUAGE_COMMAND, SHOWCHARACTERSET_COMMAND, SHOWLANGUAGE_COMMAND, STATS_COMMAND, STOR_COMMAND, SYST_COMMAND, SYSTEM_USERNAME, TOO_MANY_ARGUMENTS, TYPE_COMMAND, UNKNOWN_FLAG, USER_COMMAND, WALLET_LOCATION, XMKD_COMMAND, XPWD_COMMAND, XRMD_COMMAND
SERVERSTATUS_DISPOSED, SERVERSTATUS_RUNNING, SERVERSTATUS_STARTING, SERVERSTATUS_STOPPED, SERVERSTATUS_STOPPING, SERVERSTATUS_SUSPENDED, SERVERSTATUS_UNKNOWN
Constructor and Description |
---|
FtpsServer() |
Modifier and Type | Method and Description |
---|---|
protected FtpServerChannel |
createChannel(Socket commandSocket,
String threadName,
int channelSequence,
boolean reachedMaximumConnections)
Create a channel.
|
String |
getServerName()
Gets the FTPS server's name.
|
protected ServerSocketFactory |
getServerSocketFactory()
Gets the server socket factory.
|
SSLContext |
getSSLContext()
Returns the SSLContext
|
String |
getWalletLocationKey() |
protected boolean |
hasImplicitSecurity() |
void |
initialize()
Initializes this Server.
|
protected void |
initializeSSLContext(String walletLocation,
String walletPassword) |
protected void |
logStartupMsg() |
static void |
main(String[] args) |
protected void |
registerCommands()
Register the Commands that this Server invokes.
|
addFtpSession, clearDerivedProperties, closeSocketServer, commandCharacterSetIsUserCharacterSet, dispose, establishServerSocket, getAcceptQueueSizeKey, getAnonymousAllowedKey, getBannerText, getBindAddress, getCachePerformance, getCommandCharacterSetIsUserCharacterSetKey, getCommandInvoker, getConnectionPoolPerformance, getControlPort, getCurrentSessionsCount, getDefaultCommandCharacterSet, getDefaultCommandCharacterSetKey, getDefaultPort, getDescriptiveName, getGuestSession, getHostAddressKey, getHostname, getHostNameKey, getLibraryVersionKey, getLocale, getLocalhostKey, getLogger, getLoggerForLegacyLogging, getMaximumConnections, getMaximumConnectionsKey, getPortKey, getResourceString, getResourceString, getSessionTimeoutKey, getSessionTimeoutPeriodProperty, handlePropertyChangeRequest, handlePropertyChangeRequest, handleStopRequest, isAnonymousAllowed, isPropertyReadonly, postRun, preRun, releaseGuestSession, removeChannel, removeFtpSession, run, shouldHandlePropertyRequest, shutdown
checkSession, connectSession, constructSession, convertTimerInterval, convertTimerInterval, convertTimerInterval, getLastTimerActivation, getNextTimerActivation, getService, getTimerActivationPeriod, getTimerClassName, getTimerConfiguration, handlePriorityChangeRequest, handlePropertyChangeRequest, handleRequest, handleRequests, handleResumeRequest, handleServerStateControllerRequest, handleSuspendRequest, handleTimerExpired, isNonCompeting, isServiceAvailable, isTimerActive, isTokenNonCompeting, postCheckServerStateRequest, postRequest, processEvent, processEvents, queueEvent, resetTimer, restart, resume, serviceAvailabilityCheckNeeded, setPriority, setProperty, setProperty, start, startTimer, stop, stopRequested, stopTimer, suspend, timerExpired, waitForServiceAvailability, waitServer
acquireSession, constructLibrarySessionPool, createServerState, deregister, disconnectSession, getConfigurationOverridesTable, getConfigurationTable, getCredential, getDesiredStatus, getIfsHome, getInitialConfigurationTable, getName, getNode, getNodeName, getOracleHome, getParameterTable, getPriority, getProperties, getProperty, getServerConfigurationName, getServerState, getServerStateValue, getServerType, getServiceName, getSession, getStateTable, getStatus, getSystemUserCredential, handleServerConfigurationOverrideRequest, handleServerStateEvent, initialize, initialize, isAgent, isDisposed, isInitialized, isLogged, log, log, log, releaseSession, releaseSession, setDesiredStatus, setDesiredStatus, setSessionTimeoutPrevented, setStateProperty, setStatus, startStandalone, startStandalone, supportsPriority, supportsSuspendResume, toStatusLabel, toStatusLabel, toStatusLabel, verifyNotDisposed, verifyNotDisposed
protected boolean m_IsSecurityImplicit
protected SSLContext m_SSLContext
public String getServerName()
getServerName
in class FtpServer
public String getWalletLocationKey()
public void initialize() throws IfsException, Exception
This method is called when the Server is first loaded.
If this method throws an exception, loading of the Server is aborted.
initialize
in class FtpServer
Exception
- if the operation failsIfsException
protected void logStartupMsg() throws Exception
logStartupMsg
in class FtpServer
Exception
protected void initializeSSLContext(String walletLocation, String walletPassword) throws Exception
Exception
public SSLContext getSSLContext()
protected void registerCommands() throws Exception
FtpServer
registerCommands
in class FtpServer
Exception
protected FtpServerChannel createChannel(Socket commandSocket, String threadName, int channelSequence, boolean reachedMaximumConnections) throws Exception
FtpServer
createChannel
in class FtpServer
Exception
protected ServerSocketFactory getServerSocketFactory()
FtpServer
getServerSocketFactory
in class FtpServer
protected boolean hasImplicitSecurity()
Copyright © 2023. All rights reserved.