No AUTH TLS on objSSH.Connect

Hello,

I am running the VB6 sample code from your site for a secure login:

Set objSSH = CreateObject("sfFTPLib.SSHConnection")
...
objSSH.Host = "[mysite]"
objSSH.Port = 21
objSSH.Username = "[myUser]"
objSSH.Password = "[myPassword]"
objSSH.LogFile.File = "VB6Demo.log"

If objSSH.Connect = sfFTPLib.enumError.ftpErrorSuccess Then
...

It is getting a connect failed. When I check the VB6Demo.log is shows:

[20100730 18:55:37] SmartFTP FTP Library 2.0.86.0
[20100730 18:55:41] Resolving host name "[mySite]"
[20100730 18:55:41] Connecting to [myIPAddress] Port: 21
[20100730 18:55:41] 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
[20100730 18:55:41] 220-You are user number 2 of 38 allowed.
[20100730 18:55:41] 220-Local time is now 11:54. Server port: 21.
[20100730 18:55:41] 220-This is a private system - No anonymous login
[20100730 18:55:41] 220-IPv6 connections are also welcome on this server.
[20100730 18:55:41] 220 You will be disconnected after 15 minutes of inactivity.
[20100730 18:56:11] Timeout (30s).
[20100730 18:56:11] Client closed the connection.

I am able to log in with the SmartFTP user interface. Here is what the log says:

[11:36:55] SmartFTP v4.0.1130.0
[11:36:55] Resolving host name "[mySite]"
[11:36:55] Connecting to [myIPAddress] Port: 21
[11:36:55] Connected to [mySite].
[11:36:55] 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
[11:36:55] 220-You are user number 1 of 38 allowed.
[11:36:55] 220-Local time is now 11:35. Server port: 21.
[11:36:55] 220-This is a private system - No anonymous login
[11:36:55] 220-IPv6 connections are also welcome on this server.
[11:36:55] 220 You will be disconnected after 15 minutes of inactivity.
[11:36:55] AUTH TLS
[11:36:55] 234 AUTH TLS OK.
[11:36:55] TLS 1.0 encrypted session established.
[11:36:55] Key Exchange: 1024 bit RSA
[11:36:55] Session Cipher: 128 bit RC4
[11:36:55] Command channel protection set to Private.
[11:36:55] PBSZ 0
[11:36:55] 200 PBSZ=0
[11:36:55] USER [myUser]
[11:36:55] 331 User [myUser] OK. Password required
[11:36:55] PASS (hidden)
... and more lines. It connects just fine...

The difference is that in the user interface it starts the AUTH TLS process, but in my VB6 app it stops before it does that. It then times out after 30 seconds.
Do you have any ideas?

Should the object creation be sfFTPLib.SSHConnection? It seems like it should be .SSLConnection, but I don't see that in your documentation.


Thanks for your help.

SFTP/SSH is on port 22 and not 21.

Thanks for the reply. I changed the port to 22. The log now shows:

[20100803 19:10:46] SmartFTP FTP Library 2.0.86.0
[20100803 19:10:46] Resolving host name "mySite"
[20100803 19:10:46] Connecting to 63.232.53.150 Port: 22
[20100803 19:11:07] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
[20100803 19:11:07] Client closed the connection.
[20100803 19:11:07] 2

Is there another step I need to take in VB6 to get it to connect securely?

You are using a SSHConnection but what you need is the FTPConnectionSTA class. Look at the Module1.bas sample in the Samples\FTP\VB6\ folder:

....
objFTP.Host = "63.232.53.150"
objFTP.Port = 21
objFTP.Protocol = ftpProtocolSSLExplicit
objFTP.Username = "anonymous"
objFTP.Password = "test@test.com"
objFTP.Passive = True
objFTP.LogFile.File = "VB6Demo.log"
...

Thank you. I started with the wrong sample code. It works fine now.