Connection Error

I am using the FTP Client Library for a SSH-FTP connection. On my Connect event I am getting a return code of 4, which I'm taking to mean is a timeout error. Is this while trying to connect to the FTP server? How do I increase my timeout time?

Take a look at the log first. pSSHConnection->LogFile->File

Where would I look for this log file? I try setting the object.Logfile property and I get an error "Object doesn't support this property or method"

You can find the ISSHConnection properties in the help file or in one of the many samples that are provided.

This is a snippet of my code, modeled after the VB6 sample (I've looked at the samples for the other languages and the log file is set the same way):

Set obj = CreateObject("sfFTPLib.SSHConnection")

obj.Host = "elink-sshftp.bankofamerica.com"
obj.Port = 22
'TESTING
'obj.UserName = "XXXXXX"
'PRODUCTION
obj.UserName = "XXXXXX" '
obj.Password = "XXXXXX"
obj.LogFile = "PosPayFTP.log"

When I step through the program, I get the following error at the obj.LogFile line:

#438 Object doesn't support this property or method

It's obj.LogFile.File = "blbalb.log"

OK, sorry bout that. This is what my log file says:

[20110825 13:16:25] SmartFTP FTP Library 2.0.137.0
[20110825 13:16:33] Resolving host name "elink-sshftp.bankofamerica.com"
[20110825 13:16:33] Connecting to 171.161.160.130 Port: 22
[20110825 13:16:34] SSH-2.0-Connect:Enterprise_UNIX_2.4.02
[20110825 13:16:34] Starting SSH session. Remote Id: "SSH-2.0-Connect:Enterprise_UNIX_2.4.02"
[20110825 13:16:34] SSH protocol version reply. Client Id: SSH-2.0-SmartFTP
[20110825 13:16:34] Key Exchange Algorithm: diffie-hellman-group-exchange-sha1
[20110825 13:16:34] Host key verification failed.
[20110825 13:16:34] Client closed the connection.
[20110825 13:16:34] 2
[20110825 13:16:34] Socket Exception. Reason=0
From the line that says Host key verification failed, does that mean my machine? The code in place was running successfully before the trial period expired. The license was purchased, and I'm getting the Timeout. The only thing that changed in the code itself was I included the logic from the samples regarding the xml and the license information and setting the log file. The trial version had been downloaded mid-June, the license purchased yesterday. Is there any program or steps that need to be taken so that the machine the license was for transmits the correct verification? The objGlobal.LoadLicenseKeyData method tells me that the key is verified.

OK, will try. Do I need to uninstall the existing version or can I install right over it?

You can install it over the existing version.

Unfortunately, after install and rebooting of the server it is running on, I still get the timeout. Here's the log:

[20110825 17:19:28] Client closed the connection.
[20110825 17:32:13] SmartFTP FTP Library 2.0.137.0
[20110825 17:32:22] Resolving host name "elink-sshftp.bankofamerica.com"
[20110825 17:32:22] Connecting to 171.161.160.130 Port: 22
[20110825 17:32:22] SSH-2.0-Connect:Enterprise_UNIX_2.4.02
[20110825 17:32:22] Starting SSH session. Remote Id: "SSH-2.0-Connect:Enterprise_UNIX_2.4.02"
[20110825 17:32:22] SSH protocol version reply. Client Id: SSH-2.0-SmartFTP
[20110825 17:32:22] Key Exchange Algorithm: diffie-hellman-group-exchange-sha1
[20110825 17:32:24] Server "ssh-rsa" host key fingerprint: 7B:5A:F0:04:8E:48:A4:BC:BD:46:E8:3D:1F:C2:44:55
[20110825 17:32:24] Key exchange completed.
[20110825 17:32:24] Host Key Algorithm: ssh-rsa
[20110825 17:32:24] Client to Server Encryption: 3des-cbc
[20110825 17:32:24] Server to Client Encryption: 3des-cbc
[20110825 17:32:24] Session MAC: hmac-sha1
[20110825 17:32:24] Client to Server Compression: zlib
[20110825 17:32:24] Server to Client Compression: zlib
[20110825 17:32:24] Requesting service "ssh-userauth".
[20110825 17:32:24] RTT: 162.635 ms
[20110825 17:32:24] Authentication request. Method: password
[20110825 17:32:24] Server supported authentications: publickey,keyboard-interactive
[20110825 17:32:24] Authentication request. Method: publickey
[20110825 17:32:24] Exception. Error=0x80090008
[20110825 17:34:24] Timeout (120s).
[20110825 17:34:24] Client closed the connection.

This is the code, up to the point of connecting (sensitive information removed):

Dim obj
Dim oKeyManager
'Variables used for processing
Dim iFTPCount As Integer
Dim strRemoteFile As String
Dim strLocalFile As String
Dim GoodRun As Integer
Dim sGoodFile As String

On Error GoTo err_ooops
Set objGlobal = CreateObject("sfFTPLib.Global")
'
Dim strKey As String '''
' New Version
strKey = strKey & "<?xml version=""1.0"" ?>" & Chr(13) & Chr(10)
strKey = strKey & "<License>" & Chr(13) & Chr(10)
strKey = strKey & "<Version>2.1</Version>" & Chr(13) & Chr(10)
strKey = strKey & "<Id>############</Id>" & Chr(13) & Chr(10)
strKey = strKey & "<Name>XXXXXXXX</Name>" & Chr(13) & Chr(10)
strKey = strKey & "<Email>XXXXXX@mfri.com</Email>" & Chr(13) & Chr(10)
strKey = strKey & "<Company>MFRI Inc</Company>" & Chr(13) & Chr(10)
strKey = strKey & "<Product>SmartFTP FTP Library</Product>" & Chr(13) & Chr(10)
strKey = strKey & "<Features>" & Chr(13) & Chr(10)
strKey = strKey & "<Feature>FTP</Feature>" & Chr(13) & Chr(10)
strKey = strKey & "<Feature>SFTP</Feature>" & Chr(13) & Chr(10)
strKey = strKey & "</Features>" & Chr(13) & Chr(10)
strKey = strKey & "<Users>1</Users>" & Chr(13) & Chr(10)
strKey = strKey & "<Maintenance>2012-08-24</Maintenance>" & Chr(13) & Chr(10)
strKey = strKey & "<Issue>2011-08-24</Issue>" & Chr(13) & Chr(10)
strKey = strKey & "<Signature>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</Signature>" & Chr(13) & Chr(10)
strKey = strKey & "</License>" & Chr(13) & Chr(10)
If objGlobal.LoadLicenseKeyData(strKey) Then
'MsgBox ("License key verified.")
Else
'MsgBox ("Failed to verify license key.")
End If


Set obj = CreateObject("sfFTPLib.SSHConnection")

obj.Host = "elink-sshftp.bankofamerica.com"
obj.Port = 22
'TESTING
'obj.UserName = "XXXXXXXX"
'PRODUCTION
obj.UserName = "XXXXXXXX" '
obj.Password = "XXXXXXXX"
obj.LogFile.File = "PosPayFTP.log"

'objSSH.UseMessageLoop = True
' Public Key Authentication
' Uncomment to load private key
'Dim oKeyManager
Set oKeyManager = CreateObject("sfFTPLib.KeyManager")
Dim oPrivateKey
Set oPrivateKey = oKeyManager.LoadFile("C:\BOA_SSHInfo\PosPay-BoA-prv", "XXXXXX")
obj.PrivateKey = oPrivateKey

' Set Authenciation Methods
' Uncomment to set authentication methods
Dim arAuthentications(1)
arAuthentications(0) = ftpSSHAuthenticationPassword
arAuthentications(1) = ftpSSHAuthenticationPublicKey
obj.Authentications = arAuthentications


' Limit Encryptions
' Uncomment to limit encryptions
Dim arEncryptions(3)
arEncryptions(0) = ftpEncryption3DES
arEncryptions(1) = ftpEncryptionAES256
arEncryptions(2) = ftpEncryptionAES192
arEncryptions(3) = ftpEncryptionAES128
obj.Encryptions = arEncryptions

' Limit Compression Algorithms
Dim arCompressions(2)
arCompressions(0) = ftpSSHCompressionzlibopenssh
arCompressions(1) = ftpSSHCompressionzlib
arCompressions(2) = ftpSSHCompressionNone
obj.Compressions = arCompressions


obj.TimeOut = 120
Dim strMsg
Dim ret
ret = obj.Connect()
If ret = ftpErrorSuccess Then

You are still using the old version:
SmartFTP FTP Library 2.0.137.0

Installed, same message. Will try rebooting server this is installed on

[20110825 17:58:53] SmartFTP FTP Library 2.0.138.0
[20110825 17:59:03] Resolving host name "elink-sshftp.bankofamerica.com"
[20110825 17:59:03] Connecting to 171.161.160.130 Port: 22
[20110825 17:59:03] SSH-2.0-Connect:Enterprise_UNIX_2.4.02
[20110825 17:59:03] Starting SSH session. Remote Id: "SSH-2.0-Connect:Enterprise_UNIX_2.4.02"
[20110825 17:59:03] SSH protocol version reply. Client Id: SSH-2.0-SmartFTP
[20110825 17:59:04] Key Exchange Algorithm: diffie-hellman-group-exchange-sha1
[20110825 17:59:04] Server "ssh-rsa" host key fingerprint: 7B:5A:F0:04:8E:48:A4:BC:BD:46:E8:3D:1F:C2:44:55
[20110825 17:59:04] Key exchange completed.
[20110825 17:59:04] Host Key Algorithm: ssh-rsa
[20110825 17:59:04] Client to Server Encryption: 3des-cbc
[20110825 17:59:04] Server to Client Encryption: 3des-cbc
[20110825 17:59:04] Session MAC: hmac-sha1
[20110825 17:59:04] Client to Server Compression: zlib
[20110825 17:59:04] Server to Client Compression: zlib
[20110825 17:59:04] Requesting service "ssh-userauth".
[20110825 17:59:05] RTT: 140.880 ms
[20110825 17:59:05] Authentication request. Method: password
[20110825 17:59:05] Server supported authentications: publickey,keyboard-interactive
[20110825 17:59:05] Authentication request. Method: publickey
[20110825 17:59:05] Exception. Error=0x80090008
[20110825 18:01:05] Timeout (120s).
[20110825 18:01:05] Client closed the connection.