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

FTPSClient not properly supporting CCC and PROT P

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 3.0
    • FTP
    • None
    • Applies to all environments

    Description

      FTPSClient does not behave properly after issuing CCC (Clear Command Channel). Proper behaviour is to close SSLSocket, but keep underlying connection without SSL open.
      To achieve this, the SSLSocket should be created with "false", like this on line 255 (of FTPSClient v2.2)

      SSLSocket socket =
      (SSLSocket) ssf.createSocket(socket, ip, port, false);

      Furthermore, on sendCommand CCC, sslSocket must be closed before setting _socket = _plainsocket on line 493:
      _socket.close();
      _socket = _plainsocket;
      ...

      And finally, it is wrong to set socket factory to null on line 500 of the same method; this is set properly in exexPROT and should not be reset on CCC.

      Attachments

        1. CCC_bugs_in_FTPSClient.patch
          2 kB
          Leif John Korshavn
        2. CCCTester.java
          3 kB
          Erick Lichtas

        Activity

          People

            Unassigned Unassigned
            korshavn Leif John Korshavn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: