Using TidFTP with SFTP

Hello,

I'm trying to connect to an ftp-server using TidFTP. The server uses SFTP on 
port 22. My test project isn't able to connect to the server, it always 
generate's a timeout exception when i'm trying to connect.

The timeout is generated in the procedure TIdFTP.Connect on the line 'LCode 
= GetResponse;' this line eventually calls the 
TIdTCPConnection.GetInternalResponse loop which will generate the timeout 
(this loop gets one answer from the server (protocol info) but never 
receives an IsEndMarker).

I've included two wireshark traces of a connect to the same server, same 
password, no cert :

- indy trace with my program ending with an exception ( [http://www.oec.nl/indy.pcap|http://www.oec.nl/indy.pcap] )
- synapse project which seams to work ok (connect's and does a dir listing 
using cryptlib). I prefer using Indy! ( [http://www.oec.nl/synapse.pcap|http://www.oec.nl/synapse.pcap] )

Thanks in advance!

Charik van Hagen


My test program settings:


  lParams := TStringList.Create;
  lFtp := TIdFTP.Create(nil);
  lHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
  try
    lParams.CommaText := memParams.Lines.CommaText;

    lHandler.SSLOptions.Mode := sslmClient;
    lHandler.SSLOptions.CertFile := '';
    lHandler.SSLOptions.KeyFile := '';
    lHandler.SSLOptions.RootCertFile := '';
    lHandler.SSLOptions.Method := sslvSSLv23;
    lHandler.SSLOptions.VerifyDepth := 0;

    lHandler.OnGetPassword := IdServerIOHandlerSSLOpenSSL1GetPassword; // 
never gets called
    lHandler.OnStatusInfo := IdServerIOHandlerSSLOpenSSL1StatusInfo; // 
never gets called
    lFtp.IOHandler := lHandler;

    lFtp.Host := lParams.Values[ 'HOST' ];
    lFtp.Port := StrToInt( lParams.Values[ 'PORT' ] );
    lFtp.Username := lParams.Values[ 'USERNAME' ];
    lFtp.Password := lParams.Values[ 'PASSWORD' ];

    lFtp.UseTLS := utUseExplicitTLS;
    lFtp.DataPortProtection := ftpdpsPrivate;
    lFtp.ReadTimeout := 3000;
    lFtp.AUTHCmd := tAuto;

    try
      lFtp.Connect;
    except
      on E: Exception do
      begin
        Log('Exception: ' + E.Message);
        Exit;
      end;
    end;

    if lFtp.UsingSFTP then
      Log( 'USINGSFTP=TRUE' )
    else
      Log( 'USINGSFTP=FALSE' );

  finally
    FreeAndNil( lFtp );
    FreeAndNil( lHandler );
    FreeAndNil( lParams );
  end;
0
Charik
4/8/2009 8:48:07 AM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

5 Replies
6712 Views

Similar Articles

[PageSpeed] 38

<Charik van Hagen> wrote in message news:102638@forums.codegear.com...

> I'm trying to connect to an ftp-server using TidFTP. The server
> uses SFTP on port 22. My test project isn't able to connect to
> the server, it always generate's a timeout exception when i'm
> trying to connect.

Your FTP server is using SSH, but you are trying to connect to it using SSL 
instead.  SSH and SSL are very different protocols.  Indy does not support 
SSH at this time.

Also, if you are connecting to a port that is encrypted from the very 
beginning, then utUseExplicitTLS is the wrong value to set the UseTLS 
property to.

-- 
Remy Lebeau (TeamB)
0
Remy
4/8/2009 5:10:32 PM
Thank you very much for your swift reply. Too bad SSH is not support.

Greetings,

Charik
0
Charik
4/9/2009 7:12:04 AM
> {quote:title=Charik van Hagen wrote:}{quote}
> Thank you very much for your swift reply. Too bad SSH is not support.
> 
> Greetings,
> 
> Charik

Are there plans to support SSH in future ??
0
Alf
7/2/2009 1:37:15 PM
<Alf Christophersen> wrote in message news:133765@forums.codegear.com...

> Are there plans to support SSH in future ??

Not anytime soon.

-- 
Remy Lebeau (TeamB)
0
Remy
7/2/2009 5:17:57 PM
Remy Lebeau (TeamB) wrote:
> <Alf Christophersen> wrote in message
> news:133765@forums.codegear.com... 
> 
>> Are there plans to support SSH in future ??
> 
> Not anytime soon.

IMO the easiest way would be to use/wrap PUTTY, Filezilla provides
the C-source, if anybody is interested?

--
Arno Garrels 
..
0
Arno
7/2/2009 6:06:48 PM
Reply:

Similar Artilces:

To use or not to use Delphi
Sadly, it seems to me that there is a sort of race between the two threads, for and against using Delphi in new projects, with more or less the same users posting in both threads. Arguments are fiercely debated in both camps. Borland had their own vision. As a community, now that Delphi has changed ownership I believe we should try to be more consistent, more clear, and more articulate in what we expect from Embercadero in terms of Delphi. We can contribute to keeping Delphi alive and moving in the right direction. "Laurent Cocea" schrieb: > Sadly, it seems to me that there is a sort of race ... <snip> Some people go fishing, some go to the movies, some like to take long walks on the beach, and then some like to type their fingers bloody discussing totally irrelevant issues on public Newsgroups. And my wife likes to watch soap operas and follow posts from a forum where new-baked parents are discussing their kids-issues. Everyone needs a hobby :-) Regards, Danijel Laurent Cocea wrote: > Sadly, it seems to me that there is a sort of race between the two > threads They're essentially the same thread with a little more trolling in one than the other. Lots of free time over the holidays and all. I think the discussion in general is a good thing, though. Help remind people why a tool like Delphi is worth while, and maybe even shed some light on some of the things that still need attention. I still learn about ...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

How design a COM using Delphi and Using in PB7?
I need some component, So, we want using DELPHI5 to develop a COM or Activex. What type of knowege or Skill I must know it. Can anyone tell us? from DRAOGN Can you explain what type of component you want to create? You may not need to a) build your own, or b) use Delphi. If the component should be used from within a PB application, you ought to use PB to develop it unless it is something that PB does not let you do. regards, Bill DRAGON wrote: > I need some component, So, we want using DELPHI5 to develop a COM or > Activex. > What type of knowege or Skill I ...

delphi Win32 using delphi .NET dll
Hi, I'm trying to use a delphi.NET dll in delphi.WIN32. I am currently using CodeGear Delphi 2007 with version2(base version) of .NET I can get the dll to import into the WIN32 application the only problem is when i include things such as: "using Classes,DateUtils, SysUtils" in the .NET dll the win32 application will instantly hang when any of the dll functions are called. Any help would be great thanks. Also I have tried this example and it also crashes for me? http://cc.embarcadero.com/Item/22688 -Braden I also found this.. "The problem is that, wehn you instal...

can i use delphi 2007 bpls in delphi 2009
can i use delphi 2007 bpls in delphi 2009 ? "Gaetan SIRY" skrev i meddelelsen news:8703@forums.codegear.com... > can i use delphi 2007 bpls in delphi 2009 ? No. -- Finn Tolderlund The compatiblity between D2006 and D2007 was unique. Normaly they can't be compatible because new version enhance/change the API. And D2009 defines String = Unicode where older version has String = Ansistring so D200x/Dx-BPL are 200% incompatible with D2009. ...

How to use a delphi XE3 obj file in delphi 2007?
Hi, I'm migrating an application from delphi 2007 to delphi XE3 and I would like to do it in several steps. To do this I need to use a part of my new code (XE3) in the current delphi 2007 application. So I want to use the .obj file from my XE3 file. I know I have to use the {$L 'Filename'} and I know that I have to declare the functions that I want to use in external in my D2007 project. I wanted to make an easy and simple example to see how it works with only 1 function 'hello world' compiled in obj with XE3 but I can't find the way to use it in D2007. In D200...

Using Using
I have just completed reading a chapter in my book on performance. The books says to speed up performance on your web site you should use the using statement when opening connections. My question is how do you catch errors if you are using this as apposed to a try catch block.thanksBryan  Why would you use it as an alternative to a try/catch statement. Couldn't you just do something like  public void UsingSomeMethod() { try { SomeMethod(); } catch(SomeException e) { /// do something useful }}public void SomeMethod() { using (Something) { ...

use Winsock
How can I use Winsock in powerbuilder? Yes, I really do think to help people, when the Question is clear and specific to the point. May be You don't want to explain the whole winsock for such a question. BTW thanks for your samples. We have a full fledge system working here using Winsock developed in PB 7.0 ( Thanks to Roy also). As you said there are several possibilities; Socket connections, FTP, HTTP and many others. FX Liagre wrote: > Do you really think you help the group with this kind of "answer" ("What do > you want to do with Winsock in PB?...

MOVED: Use Delphi XE TLB importer in Delphi 2007?
....to the ActiveX group: https://forums.embarcadero.com/thread.jspa?threadID=47170 -- Craig Stuntz · Vertex Systems Corp. · Columbus, OH Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz/ ...

Using WinSock
Hi, PBuilders I am, creating DPB (Distribuited Power Builder) using WinSock but no know way configuring winsock for windows 95. Tia You will need to use and configure TCP/IP under Network Neighborhood properties -- Mike B momjb@erols.com Adalberto Rua Aguirre <nova@uio.satnet.net> wrote in article <01bc7ff9$f199bd20$9f081fc8@adalberto>... > Hi, PBuilders > > I am, creating DPB (Distribuited Power Builder) using WinSock but no know > way configuring winsock for windows 95. > > > Tia > > > ...

When to use ( and when to use ((?
I'm just not getting it. When do you use ( in a statement, when do you need to use ((, and is the space after either or both mandatory? For example, I coded this statement: if (( $_ eq $bad_guys_ip )) { more_stuff_here }; Why the two (( in an if? And why does it seem to not work when I miss the space after the ((? Thanx! Mark me as... /Corn-fused|Dense/ > I'm just not getting it. >=20 > When do you use ( in a statement, when do you need to use ((, and is > the space after either or both mandatory? >=20 > For example, I coded this sta...

If you use Delphi...
If you use Delphi for .NET with ASA, please vote for this: http://qc.borland.com/wc/qcmain.aspx?d=31677 ...

How to use AppModeler to generate Delphi forms using Cached Updates
<HTML> <TT>A beginner's question regarding AppModeler 6.1, Delphi 3, and Interbase 5.x...</TT> <P><TT>While I am impressed with the amount of thought and work that has gone into AppModeler, I have nonetheless been surprised to discover that the Delphi application generated by AppModeler is not suitable for real-world situations because of the "fly-away" problem afflicting newly-entered records.</TT> <P><TT>When I enter a record on an AppModeler-generated Delphi form, the record disappears ("flies away") immedia...

How to use a .dmp file for a system which crashes using a delphi app
Hi, I put this post here because I am not sure of the best location. I have been given a memory dump (.dmp) file by a client who thinks that a Delphi 7 application is causing their system to blue screen from time to time. Does anyone know how I can use this .dmp file to locate the problem in the delphi app? The build the client is using has debug symbols turned on. I have downloaded Microsoft Debugging Tools for windows and have dupmchk.exe (and kd.exe) but I would really appreciate some help with how these or any other useful tools should be used? Many thanks Ben > I have down...

I wrote an application and used cracked delphi 7, after i bought delphi 7
I wrote an application and used cracked delphi 7, I sold it, after i bought delphi 7 and recompiled application, is now my application legal or? > {quote:title=Ivan Ivanov wrote:}{quote} > I wrote an application and used cracked delphi 7, I sold it, after i bought delphi 7 and recompiled application, is now my application legal or? "I embezzled some money from my employer, returned the funds, and then got it back as a bonus. Can I still be arrested?" Uhhh .... didn't you just confess to a crime? > {quote:title=Ivan Ivanov wrote:}{quote} > I wrote an appli...

Debugging in Delphi XE2 using another Delphi BDS process as host
Hi I've been using delphi a long time And I always had the possibility of debbuging Packages using another Delphi process as host. This is very useful to test the design-time side of packages. Now with XE 2 I can whether running with options - Debugger - Host Application or Attach to process Any ideas? Thanks Plp Pedro wrote: > Now with XE 2 I can whether running with options - Debugger - Host > Application or Attach to process What exactly are you having trouble with? Error messages, unexpected behavior, etc. -- Remy Lebeau (TeamB) Hi Remy ...

What pattern use? How to use these patterns in Delphi XE 3? Developing new
My firwst post here, and i REALLY need yours help... My main objective is to create a _*standard system to register products, clients, sell items, control stock*_, and so on. I want to use *Multi Tier, using Datasnap*, I dont want the classic client-server systems. There are several considerations I would like to discuss: 1 - I really want to do a *GOOD system, using patters* to make easier maintenance. I have read about MVC, saw some examples, but I read examples using Interfaces, and other posts in internet say Interfaces are bad. *MVC is good for this kind of system*? 2 - I wan...

How to use winsock control in ASP.Net using VB.Net 2003?
I have to use winsock control in my ASP.net application. And don't have any idea to use it in ASP.net, but I have used it previously in VB.Net project. What I did in ASP.net  is-----I added its reference and also added it in toolbox. But it got added in Windows Forms section of toolbox. I dragged winsock control from tool box to a webform and named it as win1, then in code behind(i.e. aspx.vb) I tried to use it by typing win1 then one dot( . ) but it has not given any intellisence.So how could use winsock control in ASP.net.Can any send me link to a dummy project in which wins...

Trying to call a .DLL from Delphi XE (used to work with Delphi 6 :-) )
Hi everyone, I have a problem where perhaps some one could help point me in the right direction. In Delphi 6 I used a stand alone package to train a neural netowrk,. The trained neural network was stored as a .DEF file. The standalone software provided a .DLL and Delphi code to call the network and get the prediced values from your sw. (The .DLL was created in 2002 and apparently is 32 bit.) I have'nt used it for years but am now coming back to it.... I now use Delphi XE on Windows 7 (32 bit) The old .exe's I had compiled from that time work fine. However in Delphi XE ...

Cannot use Microsoft Excel when a Delphi application that uses automat. run [Edit]
Dear all, I built an application that connect to an Excel file using a OleObject: Excel := CreateOleObject('Excel.Application'); LCID := GetUserDefaultLCID; all works fine but I cannot use Microsoft Excel externally when my application is running. If I try to open another xls file, Excel tries to open the file in my Delphi application in read only mode. It does not even show it properly but opens a weir transparent application. I just want to be able to use Excel externally and I'd like the instance opened by my Delphi application to be independent from other Exc...

Is it posible to configure Delphi XE3 IDE to use Delphi 7 compiler/debuger
Hi! Like many other developer out there I have several project which has been developed with older version of Delphi (Delphi 7). Since theese projects rely on some components which are not compatible with newer versions of Delphi (no newer versions available) I'm forced to do any maintnance on theese projects using Delphi 7. Another solution would be to find replacment components which would provide me with same capabilities and work with latest versions of Delphi. But this would probbably require compleete rewritings of my projects (lots and lots of work). So currently I'm using...

How to use the arguments to use() in the package being used
Howdy,=20 The subject says it all believe it or not :) What I'm trying to figure out is how to pass an argument=20 (pragma I believe is the proper term) to use() and do=20 sonethign in the package based on it. I've looked at CGI.pm source but can't seem to track it down.=20 (Similar idea as to CGIs -oldstyle_urls -newstyel_urls) http://search.cpan.org/~lds/CGI.pm-3.04/CGI.pm#PRAGMAS What I'd like to do is something like this: # for old time's sake we'll just use our favorite module use Foo::Monkey qw(:Foo :Bar -doamazingthings); #then in Foo::Monkey...

Use of SFTP::Foreign with backend processing and having problems ( not apparent within the code ) in getting remote SFTP to quit it's processes
I am running AS 5.10.1 on Windows XP SP3 and attempting to use sFTP within my processing communicating to MVS/IBM. What I am trying to do is to do so many gets, then undef the variable and re-login and to continue on to end of processing. I did this with the FTP processing and never had any problems. What I am seeing is when I do the above and go through the login/undef say three times, it has the remote processes all still open. If I run through 5 times, then I have five processes open. But if I close the script completely, then all the processes quit as expected. How would ...

Code regardin post: Spread 8 COM
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_5f856.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" Code samples Spread Custom Cell Sample.zip = Delphi code Spread_ActiveX_Samples.zip = GrapeCity sample (VB, VC) -- Regards, Ronald Hoek Application Developer ComponentAgro B.V. Oud-Beijerland - The Netherlands http://www.componentagro.nl KvK: H24264020 --JivePart=_5f856.zeB8CwDOH5aMJzMl Content-Type: application/zip; name="Spread_Act...

Web resources about - Using TidFTP with SFTP - embarcadero.delphi.winsock

Resources last updated: 2/15/2016 6:19:58 PM