EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Connection Fail (SimpleSftpDemo_VS2005)

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
Posted: 01/14/2013 06:54:32
by Edward Heaton (Standard support level)
Joined: 01/14/2013
Posts: 6


I've searched the knowledge base, and this forum but still can't solve my problem.

I am using the SimpleSftpDemo_VS2005 solution.

We have a remote SSH Server, when I pass the credentials, the 'SftpClient.Open()' function causes an exception.
The exception message is: "SFTP Error 11"

I've tried to find info on this error code but can't find anything. (only "11" I can find is ERROR_SSH_INVALID_PACKET_SIZE which I can't imagine is correct!)

Using the same credentials I can log on using TOAD's FTP Client (for Oracle) so I know the credentials are correct.

(Port is 22)

Any ideas please?

Posted: 01/14/2013 06:59:11
by Eugene Mayevski (Team)

Can you please post the log produced by the sample application here? We need to see at what exactly stage the error happens.

Sincerely yours
Eugene Mayevski
Posted: 01/14/2013 07:33:42
by Edward Heaton (Standard support level)
Joined: 01/14/2013
Posts: 6

Exception occurs in the "Connect" function: (on the line SftpClient.Open())
(ex.Message returns "SFTP Error 11")
Private Sub Connect()
Dim dlg As frmConnProps

If SftpClient.Active Then
System.Windows.Forms.MessageBox.Show(Me, "Already connected")
Exit Sub
End If
dlg = New frmConnProps
If (dlg.ShowDialog(Me) = Windows.Forms.DialogResult.OK) Then
SftpClient.Username = dlg.tbUsername.Text
SftpClient.Password = dlg.tbPassword.Text
SftpClient.Address = dlg.tbHost.Text
SftpClient.Port = 22

Dim key As New TElSSHKey
Dim privateKeyAdded As Boolean = False
If dlg.edPrivateKey.TextLength > 0 Then
Dim pwd As String
pwd = InputDialog("Enter password", "Enter password for private key:", "")
Dim err As Integer
err = key.LoadPrivateKey(dlg.edPrivateKey.Text, pwd)
If err = 0 Then
SftpClient.AuthenticationTypes = SftpClient.AuthenticationTypes Or SBSSHConstants.Unit.SSH_AUTH_TYPE_PUBLICKEY
privateKeyAdded = True
Log("Private key file could not be loaded due to error " + err.ToString(), True)
End If
End If

If Not privateKeyAdded Then
SftpClient.AuthenticationTypes = SftpClient.AuthenticationTypes And Not SBSSHConstants.Unit.SSH_AUTH_TYPE_PUBLICKEY
End If

Catch ex As Exception
Log("Connection failed due to exception: " + ex.Message, True)
Log("If you have ensured that all connection parameters are correct and you still can't connect,", True)
Log("please contact EldoS support as described on http://www.eldos.com/sbb/support-tech.php", True)
Log("Remember to provide details about the error that happened.", True)
If SftpClient.ServerSoftwareName.Length > 0 Then
Log("Server software identified itself as: " + SftpClient.ServerSoftwareName, True)
End If
End Try
Exit Sub
End Try
Log("SFTP connection established", False)
currentDir = "."
End If
End Sub

Posted: 01/14/2013 07:36:42
by Vsevolod Ievgiienko (Team)

Please post here the log produced by the sample.
Posted: 01/14/2013 07:46:03
by Edward Heaton (Standard support level)
Joined: 01/14/2013
Posts: 6

Sorry, I'm being a bit slow here - "log"?

The immediate window says:
A first chance exception of type 'SBSimpleSftp.EElSimpleSFTPClientError' occurred in SecureBlackbox.SFTP.dll

Is this what you mean?
Posted: 01/14/2013 07:49:31
by Edward Heaton (Standard support level)
Joined: 01/14/2013
Posts: 6

The exception error message actually reads:

"Connection Failed (error code is 11)"


Posted: 01/14/2013 07:54:12
by Eugene Mayevski (Team)

The sample project has a log window in the bottom part. Is there anything written in that log when you run it and attempt to connect? Not in IDE, but in the application window. We need contents of that log.

Sincerely yours
Eugene Mayevski
Posted: 01/14/2013 08:18:08
by Edward Heaton (Standard support level)
Joined: 01/14/2013
Posts: 6


The log will not allow cut & paste so I've attached a screenshot.



Posted: 01/14/2013 08:28:45
by Vsevolod Ievgiienko (Team)

Please refer to this article for solution: http://www.eldos.com/sbb/articles/4796.php
Posted: 01/14/2013 08:46:28
by Edward Heaton (Standard support level)
Joined: 01/14/2013
Posts: 6

Thanks - I added this line of code before opening the connection:

SftpClient.AutoAdjustCiphers = True

This solved the problem and I've now connected ok.

We'll be hopefully buying the license very soon.

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.



Topic viewed 1588 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!