Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0
-
None
-
None
-
Windows XP
Description
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