FTP over SSL processing. If desired, the JVM property -Djavax.net.debug=all can be used to
see wire-level SSL details.
FTPSClient
public FTPSClient()
throws NoSuchAlgorithmException
Constructor for FTPSClient.
FTPSClient
public FTPSClient(String protocol)
throws NoSuchAlgorithmException
Constructor for FTPSClient.
FTPSClient
public FTPSClient(String protocol,
boolean isImplicit)
throws NoSuchAlgorithmException
Constructor for FTPSClient.
protocol
- the protocolisImplicit
- The secutiry mode(Implicit/Explicit).
FTPSClient
public FTPSClient(boolean isImplicit)
throws NoSuchAlgorithmException
Constructor for FTPSClient.
isImplicit
- The secutiry mode(Implicit/Explicit).
Socket _openDataConnection_
protected @Override Socket _openDataConnection_(int command,
String arg)
throws IOException
Returns a socket of the data connection.
Wrapped as an SSLSocket
, which carries out handshake processing.
arg
- The arguments to the FTP command.
If this parameter is set to null, then the command is sent with
no argument.
- A Socket corresponding to the established data connection.
Null is returned if an FTP protocol error is reported at any point
during the establishment and initialization of the connection.
org.apache.commons.net.ftp.FTPClient._openDataConnection_(java.lang.String, int)
execPBSZ
public void execPBSZ(long pbsz)
throws SSLException,
IOException
PBSZ command. pbsz value: 0 to (2^32)-1 decimal integer.
pbsz
- Protection Buffer Size.
execPROT
public void execPROT(String prot)
throws SSLException,
IOException
PROT command.
C - Clear
S - Safe(SSL protocol only)
E - Confidential(SSL protocol only)
P - Private
prot
- Data Channel Protection Level.
getAuthValue
public String getAuthValue()
Return AUTH command use value.
getEnableSessionCreation
public boolean getEnableSessionCreation()
Returns true if new SSL sessions may be established by this socket.
When a socket does not have a ssl socket, This return False.
- true - Indicates that sessions may be created;
this is the default.
false - indicates that an existing session must be resumed.
getEnabledCipherSuites
public String[] getEnabledCipherSuites()
Returns the names of the cipher suites which could be enabled
for use on this connection.
When a socket does not have a ssl socket, This return null.
- An array of cipher suite names.
getEnabledProtocols
public String[] getEnabledProtocols()
Returns the names of the protocol versions which are currently
enabled for use on this connection.
When a socket does not have a ssl socket, This return null.
getNeedClientAuth
public boolean getNeedClientAuth()
Returns true if the socket will require client authentication.
When a socket does not have a ssl socket, This return False.
- true - If the server mode socket should request
that the client authenticate itself.
getTrustManager
public TrustManager getTrustManager()
Get the currently configured TrustManager
.
getUseClientMode
public boolean getUseClientMode()
Returns true if the socket is set to use client mode
in its first handshake.
When a socket does not have a ssl socket, This return False.
- true - If the socket should start its first handshake
in "client" mode.
getWantClientAuth
public boolean getWantClientAuth()
Returns true if the socket will request client authentication.
When a socket does not have a ssl socket, This return False.
- true - If the server mode socket should request
that the client authenticate itself.
int sendCommand
public @Override int sendCommand(String command,
String args)
throws IOException
I carry out an ftp command.
When a CCC command was carried out, I steep socket and SocketFactory
in a state of not ssl.
org.apache.commons.net.ftp.FTP.sendCommand(java.lang.String)
setAuthValue
public void setAuthValue(String auth)
Set AUTH command use value.
This processing is done before connected processing.
auth
- AUTH command use value.
setEnabledCipherSuites
public void setEnabledCipherSuites(String[] cipherSuites)
Controls which particular cipher suites are enabled for use on this
connection. I perform setting before a server negotiation.
cipherSuites
- The cipher suites.
setEnabledProtocols
public void setEnabledProtocols(String[] protocolVersions)
Controls which particular protocol versions are enabled for use on this
connection. I perform setting before a server negotiation.
protocolVersions
- The protocol versions.
setEnabledSessionCreation
public void setEnabledSessionCreation(boolean isCreation)
Controls whether new a SSL session may be established by this socket.
isCreation
- The established socket flag.
setKeyManager
public void setKeyManager(KeyManager keyManager)
Set a KeyManager
to use
keyManager
- The KeyManager implementation to set.
setNeedClientAuth
public void setNeedClientAuth(boolean isNeedClientAuth)
Configures the socket to require client authentication.
isNeedClientAuth
- The need client auth flag.
setTrustManager
public void setTrustManager(TrustManager trustManager)
Override the default TrustManager
to use.
trustManager
- The TrustManager implementation to set.
setUseClientMode
public void setUseClientMode(boolean isClientMode)
Configures the socket to use client (or server) mode in its first
handshake.
isClientMode
- The use client mode flag.
setWantClientAuth
public void setWantClientAuth(boolean isWantClientAuth)
Configures the socket to request client authentication,
but only if such a request is appropriate to the cipher
suite negotiated.
isWantClientAuth
- The want client auth flag.
void _connectAction_
protected @Override void _connectAction_()
throws IOException
Because there are so many connect() methods,
the _connectAction_() method is provided as a means of performing
some action immediately after establishing a connection,
rather than reimplementing all of the connect() methods.