Commands issued after CCC command fails in Commons Net 2.0
----------------------------------------------------------
Key: NET-274
URL: https://issues.apache.org/jira/browse/NET-274
Project: Commons Net
Issue Type: Bug
Affects Versions: 2.0
Environment: Windows XP
Reporter: Srikanth KM
When the FTP Client communicates with FTP Server in Explicit SSL mode, after
the exchange of data channel security commands, the Client issues the CCC
command (Clear Command Channel). A reply code of 200 is received for the CCC
command. However, the subsequent commands issued fails with the error ::
org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed
without indication.
This is occuring because after issuing the CCC Command ,(in sendCommand of
FTPSClient) the socket is switched to plane socket whereas the Input and
output streams of the socket _controlInput_ and _controlOutput_ still point to
the older secure socket.
This issue can be resolved by adding the following lines in the sendCommand ()
of FTPSClient after switching thesocket to plainSocket
_socket_ = planeSocket;
_controlInput_ = new BufferedReader(new InputStreamReader( _socket_
.getInputStream(), getControlEncoding()));
_controlOutput_ = new BufferedWriter(new OutputStreamWriter(
_socket_.getOutputStream(), getControlEncoding()));
Thanks
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.