Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-274

Commands issued after CCC command fails in Commons Net 2.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.2
    • 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            srika_km Srikanth KM
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified