EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Connection Fail (SimpleSftpDemo_VS2005)

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#23149
Posted: 01/14/2013 06:54:32
by Edward Heaton (Standard support level)
Joined: 01/14/2013
Posts: 6

Hi,

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?

Ted
#23150
Posted: 01/14/2013 06:59:11
by Eugene Mayevski (EldoS Corp.)

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
#23151
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

KeyStorage.Clear()
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
KeyStorage.Add(key)
SftpClient.AuthenticationTypes = SftpClient.AuthenticationTypes Or SBSSHConstants.Unit.SSH_AUTH_TYPE_PUBLICKEY
privateKeyAdded = True
Else
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

Try
SftpClient.Open()
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
Try
SftpClient.Close(True)
Catch
End Try
Exit Sub
End Try
Log("SFTP connection established", False)
currentDir = "."
RefreshData()
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Cheers.
#23152
Posted: 01/14/2013 07:36:42
by Vsevolod Ievgiienko (EldoS Corp.)

Please post here the log produced by the sample.
#23153
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?
#23154
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)"

Ted.


.
#23155
Posted: 01/14/2013 07:54:12
by Eugene Mayevski (EldoS Corp.)

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
#23156
Posted: 01/14/2013 08:18:08
by Edward Heaton (Standard support level)
Joined: 01/14/2013
Posts: 6

ok.

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

Ted

.


#23158
Posted: 01/14/2013 08:28:45
by Vsevolod Ievgiienko (EldoS Corp.)

Please refer to this article for solution: http://www.eldos.com/sbb/articles/4796.php
#23159
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.

Ted.
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 1437 times

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




|

Back to top

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

Got it!