Bad command in FTPS

Giganews Newsgroups
Subject: Bad command in FTPS
Posted by:  Gilberto Cardoso (gilber…@mgr.com.br)
Date: Tue, 7 Oct 2008

Hi,

I am using Indy 10 on Delphi 7 for Win32.
I am connecting to an FTPS server using the following parcial code:

Var IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL;
Var Ftp:TIdFTP;
begin
    //------------------------------------------------------------------------//
    IdSSLIOHandlerSocketOpenSSL1 :=
TIdSSLIOHandlerSocketOpenSSL.Create(NIL);
    IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvSSLv3;
    IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Mode := sslmClient;
    //------------------------------------------------------------------------//
    Ftp :=  TIdFTP.Create(NIL);
    Ftp.IOHandler := IdSSLIOHandlerSocketOpenSSL1;
    Ftp.Passive := TRUE;
    Ftp.UseTLS := utUseImplicitTLS;
    Ftp.DataPortProtection := ftpdpsPrivate;
    //------------------------------------------------------------------------//
    Ftp.Host :=  'xxxxx.xxxx.com';
    FtP.Port := 6366;
    Ftp.Username := 'xxxxxx';
    Ftp.Password := 'aaaaaa';

    Ftp.Connect;
    if Ftp.Connected  then
      SELF.Memo1.Lines.Add('Connected.');
    Ftp.OnStatus := IdFTP1Status;
    Ftp.ChangeDir('/receive');
    Ftp.List(SELF.Memo1.Lines);
    Ftp.Disconnect;

Below is trace:

Stat Connected.
Recv 6/10/2008 13:40:12: 220 Services Secure FTP Version 2.2 (Session
#10416)<EOL>
Sent 6/10/2008 13:40:12: USER xxxxxx<EOL>
Recv 6/10/2008 13:40:14: 331-220 Batch FTP server IDA6510 built Aug  1 2005
ready.<EOL>
Recv 6/10/2008 13:40:15: 331 Password required for xxxxxx<EOL>
Sent 6/10/2008 13:40:15: PASS aaaaaa<EOL>
Recv 6/10/2008 13:40:15: 230 User logged in, proceed.<EOL>
Sent 6/10/2008 13:40:15: FEAT<EOL>
Recv 6/10/2008 13:40:16: 502 Bad command or it is not implemented here.<EOL>
Sent 6/10/2008 13:40:16: TYPE I<EOL>
Recv 6/10/2008 13:40:16: 200 Type set to I.<EOL>
Sent 6/10/2008 13:40:16: SYST<EOL>
Recv 6/10/2008 13:40:17: 215 ICS.<EOL>
Sent 6/10/2008 13:40:17: CWD /receive<EOL>
Recv 6/10/2008 13:40:17: 250 "receive" is current directory. <EOL>
Sent 6/10/2008 13:40:17: TYPE A<EOL>
Recv 6/10/2008 13:40:18: 200 Type set to A.<EOL>
Sent 6/10/2008 13:40:18: PBSZ 0<EOL>
Recv 6/10/2008 13:40:18: 502 Bad command or it is not implemented here.<EOL>
Sent 6/10/2008 13:40:18: PROT P<EOL>
Recv 6/10/2008 13:40:19: 502 Bad command or it is not implemented here.<EOL>
Sent 6/10/2008 13:40:19: TYPE I<EOL>
Recv 6/10/2008 13:40:19: 200 Type set to I.<EOL>

Any commands are not acceptable and my application don't work?
What am I doing wrong??

thanks for any help!

Replies