Jump to content


Photo

Problem with SFTP


  • Please log in to reply
19 replies to this topic

#1 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 31 March 2009 - 06:57 AM

We have encountered again problems with SFTP:
When I try to connect to a server, the ftp library crashes at "If objFTP.Connect = sfFTPLib.enumError.ftpErrorSuccess Then"

You can try it with your VB6 sample project and following server:

objFTP.Host = "ftpd.ils-consult.fr"
objFTP.Port = 22
objFTP.Username = "smartftp"
objFTP.Password = "smartftp"
objFTP.LogFile = "c:\sftp.log"

I really need some help, because at the moment it's not possible to use SFTP with SmartFTP-Library.

Regards,
Markus

#2 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 31 March 2009 - 10:43 AM

I will take a look at it. In the meanwhile try to set the objFTP.UseMessageLoop property to true

Regards,
Mat

#3 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 31 March 2009 - 11:25 AM

No change if I set objFTP.UseMessageLoop property to true ...

#4 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 31 March 2009 - 11:33 AM

Are the VBScript examples (Scripts\Simple.wsf) working for you?

#5 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 31 March 2009 - 01:31 PM

No. Almost the same error msg except it's WScript.exe instead of VB6.exe

Microsoft Visual C++ Runtime Library
Runtime Error!
Program: C:\WINDOWS\System32\WScript.exe

This application has requestet the Runtime to terminate it in an unusual way. Please contact the application's support team for more information

#6 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 31 March 2009 - 08:56 PM

What operating system are you using?

Can you to reproduce the problem on a fresh installation of Windows?

Regards,
Mat

#7 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 01 April 2009 - 07:24 AM

Windows XP Professional SP3.

I have tried it with a new XP installation, same error with the script examples.

#8 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 01 April 2009 - 01:18 PM

I couldn't not find any errors with the script nor the ftp library. They both work as expected. Do you have the latest version of the FTP Library: http://www.smartftp.com/ftplib
Did you register the sfFTPLib.dll (regsvr32.exe sfFTPLib.dll)?

Regards,
Mat

#9 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 02 April 2009 - 07:46 AM

Yes, I have!

[20090402 07:22:39] SmartFTP FTP Library v1.5.17.28
[20090402 07:22:39] Resolving host name "ftpd.ils-consult.fr"
[20090402 07:22:39] Connecting to 92.103.148.120 Port: 22
[20090402 07:22:39] SSH-2.0-OpenSSH_4.7
[20090402 07:22:39] Starting SSH session. Remote Id: "SSH-2.0-OpenSSH_4.7"
[20090402 07:22:39] SSH protocol version reply. Client Id: "SSH-2.0-SmartFTP"
[20090402 07:22:41] Computing session key.
[20090402 07:22:41] Key Exchange Algorithm: diffie-hellman-group-exchange-sha256
[20090402 07:22:41] Key exchange completed.
[20090402 07:22:41] Host Key Algorithm: ssh-rsa
[20090402 07:22:41] Client to Server Encryption: aes128-ctr
[20090402 07:22:41] Server to Client Encryption: aes128-ctr
[20090402 07:22:41] Session MAC: hmac-sha1
[20090402 07:22:41] Client to Server Compression: zlib@openssh.com
[20090402 07:22:41] Server to Client Compression: zlib@openssh.com
[20090402 07:22:41] Authentication request. Method: "none"
[20090402 07:22:41] Server supported authentications: publickey,password,keyboard-interactive
[20090402 07:22:41] Authentication request. Method: "password"
[20090402 07:22:42] User authentication successful.

That's the last message which can be found in the log file.

Did you try the VB6-Sample with the parameters I have posted?

objFTP.Host = "ftpd.ils-consult.fr"
objFTP.Port = 22
objFTP.Username = "smartftp"
objFTP.Password = "smartftp"
objFTP.LogFile = "c:\sftp.log"

I have tried it on different PCs, always the same problem with "If objFTP.Connect = sfFTPLib.enumError.ftpErrorSuccess Then"

The problem doesn't occur if I use a nonexistent username, then I'll get an error ftpErrorConnect = 25L

objFTP.Host = "ftpd.ils-consult.fr"
objFTP.Port = 22
objFTP.Username = "abcdefg"
objFTP.Password = "......."
objFTP.LogFile = "c:\sftp.log"

Regards,
Markus

#10 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 02 April 2009 - 01:18 PM

I have installed the latest SmartFTP-Client on 5 PCs and it's impossible to connect to ftpd.ils-consult.fr!
Always error message and crash.

#11 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 02 April 2009 - 02:07 PM

I have uploaded some crash dumps, maybe they can help:
Dumps

Edited by m.gunesch, 02 April 2009 - 02:08 PM.


#12 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 02 April 2009 - 02:37 PM

Ah the problems is only with thsi particular server. Can you provide a test account on the server?

Did you also try it with the WScript example? Does it crash exactly at the same point?

Regards,
Mat

#13 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 03 April 2009 - 12:58 PM

It seems that this only happens with that server.

This is already a test account:
objFTP.Host = "ftpd.ils-consult.fr"
objFTP.Port = 22
objFTP.Username = "smartftp"
objFTP.Password = "smartftp"

Or you can try this one:
objFTP.Host = "ftpd.ils-consult.fr"
objFTP.Port = 22
objFTP.Username = "ep_ssh"
objFTP.Password = "ep1424-Sh-+"

Regards,
Markus

#14 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 03 April 2009 - 03:12 PM

I was able to reproduce it. Thank you. Working on a fix now.

#15 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 03 April 2009 - 03:50 PM

Hello ..

I noticed that I'm not able to connect to the server with other clients (FileZilla) either. They do not crash as SmartFTP does but they seem to have the same error. The server is sending a wrong packet.

Regards,
Mat

#16 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 06 April 2009 - 01:40 PM

Please run a test with the user "ep_ssh".
With this one it's possible to connect with FileZilla.

objFTP.Host = "ftpd.ils-consult.fr"
objFTP.Port = 22
objFTP.Username = "ep_ssh"
objFTP.Password = "ep1424-Sh-+"

Regards,
Markus

#17 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 07 April 2009 - 03:40 AM

I was debugging the problem and it's caused by the delayed compression algorithm zlib@openssh.com that is being used. From my perspective it looks like that the server does not handle it correctly. It always sends the following 3 bytes back for our channel open request: 0x78 0x9c 0x92.
When the zlib@openssh.com compression algorithm is disabled everything works as expected. FileZilla, WinSCP and many other clients do not implement the zlib@openssh.com compression algorithm. That is the reason you don't see any problems with these clients.
I do not believe the zlib@openssh.com implementation broken with OpenSSH version (4.7) is broken per se. But for a final conclusion further investigations needs to be done.

To workaround your problem disable the delayed compression algorithm:
Dim arCompressions(1)
arCompressions(0) = ftpSSHCompressionzlib
arCompressions(1) = ftpSSHCompressionNone
obj.Compressions = arCompressions

Regards,
Mat

#18 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 07 April 2009 - 07:06 AM

It's impossible to set the property "Compressions" with VB6.

Dim arCompressions(1)
arCompressions(0) = ftpSSHCompressionzlib
arCompressions(1) = ftpSSHCompressionNone
obj.Compressions = arCompressions

I always get an error with obj.Compressions = arCompressions:
"Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic"

Regards,
Markus

#19 mb

mb

    Developer

  • Administrators
  • 11521 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 07 April 2009 - 06:12 PM

VB6 does not support SAFEARRAY(VARIANT). So I have changed it now to VARIANT* which can contain a SAFEARRAY(VARIANT) or SAFEARRAY(LONG). This should work with VB6.
Please try it with the latest version from here: http://www.smartftp....ftplib/download

Regards,
Mat

#20 m.gunesch

m.gunesch
  • Members
  • 16 posts

Posted 20 April 2009 - 02:29 PM

Yes. Now I'm able to set the property "Compressions".
And it's possible to connect to that FTP server.

Thanks a lot!

BR
Markus




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users