EldoS | Feel safer!

Software components for data protection, secure storage and transfer


Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
Posted: 10/10/2007 07:16:44
by  Richard Price
I have an application that calls a class library containing all the routines to SFTP. It runs perfectly. The same code when called from a web service does not run, its driving me crazy.

The error that I am getting is:

DownloadResults Open: Connection failed
DownloadResults : SBSimpleSftp.EElSimpleSFTPClientException: Connection failed
at SBSimpleSftp.TElSimpleSFTPClient.Open()
at TRS.SFTP.DownloadResults(String strFileToDownload) in C:\TRS\TRS\TRS\SFTP\SFTP.vb:line 28

The code is pasted below:

Please can you help me.


Public Sub DownloadResults(ByVal strFileToDownload As String)

Dim fsErrors As FileStream
Dim streamValidation As StreamWriter

fsErrors = New FileStream(My.Settings("FTPerrorsPath") & "errors.txt", FileMode.Create, FileAccess.Write)
streamValidation = New StreamWriter(fsErrors)


Client = New TElSimpleSFTPClient
Client.Address = My.Settings("SFTPdomain")
Client.Port = Int32.Parse(My.Settings("SFTPport"))
Client.Username = My.Settings("SFTPuserName")
Client.Password = My.Settings("SFTPpassword")



Catch ex As Exception

streamValidation.WriteLine("DownloadResults Open: " & ex.Message)
' streamValidation.WriteLine("DownloadResults : " & ex.InnerException.ToString)
streamValidation.WriteLine("DownloadResults : " & ex.GetBaseException.ToString)

Exit Sub
End Try

Client.DownloadFiles("/result_download", strFileToDownload, My.Settings("FSAresults"), TSBSFTPFileTransferMode.ftmOverwrite, False, TSBSFTPCaseConversion.sccNone, True)
Catch ex As Exception
streamValidation.WriteLine("DownloadResults DownloadFiles: " & ex.Message)
Exit Sub
End Try

End Sub
Posted: 10/10/2007 07:30:22
by Eugene Mayevski (Team)

The problem is not related to SFTP, but most likely to access permissions. When you call Open method, it internally uses some classes from SecureBlackbox.SFTPCommon, SecureBlackbox.SSHClient, SecureBlackbox.SSHCommon, SecureBlackbox.PKI and SecureBlackbox assemblies. It's likely that some of those assemblies are not available (not copied/installed properly) or not accessible (due to security permissions) or can't be loaded due to the same security permissions. The latter applies to SecureBlackbox.PKI which includes some P/Invoke calls.

Sincerely yours
Eugene Mayevski
Posted: 08/27/2010 20:36:48
by Deepa V (Basic support level)
Joined: 08/26/2010
Posts: 5

Hi Eugene,

I am having a similar problem, where in my .NET application has multiple "Connection Failed" intermittently.

please refer to my thread below:

I have multiple threads hitting the secure black box dlls at the same time, so is this a concern and maybe a cause for the "Connection Failed" exception from SBSimpleSftp.EElSimpleSFTPClientException ?
Posted: 08/28/2010 02:19:39
by Eugene Mayevski (Team)

No, your problem is different. Let's continue in your original thread.

Sincerely yours
Eugene Mayevski



Topic viewed 2657 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!