EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElSimpleSSLClient - Connection Timeout

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 04/16/2013 09:19:06
by Sean  (Basic support level)
Joined: 04/16/2013
Posts: 4


I have an application that connects to a feed via the TElSimpleSSLClient. Here's the code I'm using to connect:

   var client = new TcpClient(_host, _port);

   _stream = new SBSimpleSSL.TElSimpleSSLClient();

   _stream.Address = _host;
   _stream.Port = _port;

   _stream.SetCipherSuite(30, true);

   _sslReader = new StreamReader(client.GetStream());

catch (Exception e)

This works fine when I run it on my own box (Windows XP). However, when I run it on a Windows Server 2008 R2 machine I get the following exception from the _stream.Open() line everytime.

Exception.Type: EElSocketError
Exception.Source: SecureBlackbox.SSLClient
Exception.Message: Connection timeout

! at SBSimpleSSL.TElCustomSimpleSSLClient.DoMessageLoop(Boolean NoPeek)
at SBSimpleSSL.TElCustomSimpleSSLClient.Open()
at Plutus.Feeds.MyProxy.Connect()

Would anyone be able to suggest a reason this might be happening?
Posted: 04/16/2013 09:22:48
by Eugene Mayevski (Team)

This code doesn't make any sense to me. But anyway, if it works, then the problem is not in the code. Most likely you are not deploying dependent modules (assemblies, DLLs) to the target system. Please review the deployment instructions in the help file and ensure that you deploy all required modules.

Sincerely yours
Eugene Mayevski
Posted: 04/16/2013 09:43:48
by Sean  (Basic support level)
Joined: 04/16/2013
Posts: 4

Hi Eugene,

Thanks for the quick response.

In the 'Deployment of .NET edition' instructions it says:

To deploy SecureBlackbox components with your project, use your regular installer tool. DO NOT USE SecureBlackbox installation package (which you downloaded and installed for development) for deployment purposes.

What does it mean - regular installer tool? I have included the following DLLs in the installation folder of the app:


Is there something else I need to do?
Posted: 04/16/2013 10:05:31
by Eugene Mayevski (Team)

These assemblies should be enough.

Let's do the following tests then:

1) try running "telnet <your host> <your port>" on the machine you did deployment to. Can you connect to the server in this case?

If you can't connect, then of course you are having connectivity problems (either the firewall issue or ... ).

2) I don't see that you create OnCertificateValidate event handler in your code. This event handler is required - normally the exception should be thrown if you don't set an event handler. Please create the handler and put a breakpoint there. If the breakpoint works, this means that the component connected (socket connection was made) and started SSL/TLS handshake. Then we'll check further.

Sincerely yours
Eugene Mayevski
Posted: 04/16/2013 10:39:26
by Sean  (Basic support level)
Joined: 04/16/2013
Posts: 4

I am able to connect to the server via Telnet.

I'm not 100% what you mean regarding the OnCertificateValidate. I have added the following:

private void OnValidateCertificate(object Sender, TElX509Certificate X509Certificate, ref bool Validate)
       _logger.Error("Validate Certificate Reached");

and before the _stream.Open() I have added:

_stream.OnCertificateValidate += OnValidateCertificate;

Is this correct? It isn't hitting the OnValidateCertificate method even on the machine where it is connecting successfully.
Posted: 04/16/2013 10:56:27
by Eugene Mayevski (Team)

Yes, the code is correct. Looks like TElSocket can't connect.

There's one more thing to check:

create an instance of TElSocket class, setup its Address and Port properties and call Connect() method. See if it connects ok. If it does, then there's something with TLS handshake under the hood. If the socket doesn't connect, then it's a firewall or networking issue on the computer, and it's beyond our control. You can try connecting with .NET's Socket class as well (this class is used internally by TElSocket).

In other words we need to narrow down the place where connection fails.

Other things to check (just to ensure that they are correct):
* you call SetLicenseKey and pass a valid license key to it (it can be evaluation key or time-limited trial key).
* the value of address doesn't have extra spaces in the beginning or the end - the component doesn't trim the address.
* IPv6 is not used or, if used, the system is configured properly. Maybe it makes sense to disable IPv6 in the component.

Sincerely yours
Eugene Mayevski
Posted: 04/16/2013 11:33:05
by Sean  (Basic support level)
Joined: 04/16/2013
Posts: 4

Thanks for the suggestions Eugene.

I will try them out and get back to you if I'm still having problems.
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.



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