EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Using SSLServer as a classic .Net socket

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.
#36211
Posted: 03/12/2016 13:41:37
by Nicolas Mariot (Standard support level)
Joined: 02/28/2016
Posts: 10

It works perfectly when using the sync Accept method. But I now, I need to use the BeginAccept method.

using the following code :
Code
private void Main()
{
  // ...

  ElServerSSLSocket s = new ElServerSSLSocket();
  s.CertStorage = m_certStorage;
  s.OnError += new SBSSLCommon.TSBErrorEvent(s_OnError);
  s.Bind(GetEndPoint(443));
  s.Listen(10);
  s.BeginAccept(new AsyncCallback(AcceptCallBack), s);
}

private void AcceptCallBack(IAsyncResult cb)
{
   ElServerSSLSocket s = cb.AsyncState as ElServerSSLSocket;
   ElServerSSLSocket s2 = s.EndAccept(cb);
   s2.OpenSSLSession();
   byte[] buffer = new byte[1024];
   int recBytes = s2.Receive(buffer);
   Debug.WriteLine(ASCIIEncoding.ASCII.GetString(buffer, 0, recBytes));
}


I always get an error error_ssl_insufficient_security (75976) when trying to receive the data.

Is there something wrong with my code ?

Thanks for you answer
#36235
Posted: 03/14/2016 17:27:29
by Vsevolod Ievgiienko (Team)

The problem is that TLS does not provide means for reporting a 'no shared cipher suite' indicator to the remote side. Therefore if client/server fails to support any of the cipher suites offered by the peer, it sends back the 'insufficient security' error code. What client is used: third-party application or our component?

Also please check the sample from \EldoS\SecureBlackbox.NET\Samples\C#\SSLBlackbox\Desktop\Server\Chat\Server folder for async. methods usage sample.
#36239
Posted: 03/15/2016 10:13:07
by Nicolas Mariot (Standard support level)
Joined: 02/28/2016
Posts: 10

I'm using Firefox as a client for my WebServer.
This works perfectly when using the sync method and calling a local URL from Firefox :
Code
ElServerSSLSocket s = new ElServerSSLSocket();
s.Bind(GetEndPoint(443));
s.Listen(10);
ElServerSSLSocket s2 = s.Accept();
buffer = new byte[1024];
int recBytes = s2.Receive(buffer);
txtResultat.Text = ASCIIEncoding.ASCII.GetString(buffer, 0, recBytes);


but this does not work at all using the BeginAccept method (Insufficient security) :
Code
private void Main()
{
  // ...

  ElServerSSLSocket s = new ElServerSSLSocket();
  s.CertStorage = m_certStorage;
  s.OnError += new SBSSLCommon.TSBErrorEvent(s_OnError);
  s.Bind(GetEndPoint(443));
  s.Listen(10);
  s.BeginAccept(new AsyncCallback(AcceptCallBack), s);
}

private void AcceptCallBack(IAsyncResult cb)
{
   ElServerSSLSocket s = cb.AsyncState as ElServerSSLSocket;
   ElServerSSLSocket s2 = s.EndAccept(cb);
   s2.OpenSSLSession();
   byte[] buffer = new byte[1024];
   int recBytes = s2.Receive(buffer);
   Debug.WriteLine(ASCIIEncoding.ASCII.GetString(buffer, 0, recBytes));
}


It seems to me that it's the same code so I'm wondering what I'm doing wrong

I've already looked at the sample but they're not using the ElServerSSLSocket object which I like to use in my application : I want to use your SslSocket as a classical socket.
#36240
Posted: 03/15/2016 10:18:19
by Eugene Mayevski (Team)

The problem you describe requires deep analysis and debugging of the code you have written (I mean that we'd need you to create a sample project and run it locally). This is the work, which, per our Support Policy ( https://www.eldos.com/support_policy.php ), is not included in Standard support. I am sorry to say this, yet you need Premium support level.

Premium support is included for certain period of time with new licenses, and can also be purchased separately via https://www.eldos.com/support/calc.php .

Once you purchase the Premium Support license, you will get a Support Access Ticket and instructions for adding this ticket to your account.
After this is done, we can work on your issue.


Sincerely yours
Eugene Mayevski
#36262
Posted: 03/18/2016 11:30:45
by Nicolas Mariot (Standard support level)
Joined: 02/28/2016
Posts: 10

As you'ce recommended, I bought a premium support license. Could you help me on my issue please ?

Short reminder :
* Using firefox and Accept works well
* Using firefox and BeginAccept = no data


Thanks for your help
#36263
Posted: 03/18/2016 11:46:17
by Eugene Mayevski (Team)

Do you have some simple test case that you could share with us so that we don't blindly try to reproduce the issue? If yes, I will create a helpdesk ticket for you to post the archive there.


Sincerely yours
Eugene Mayevski
#36264
Posted: 03/18/2016 11:53:40
by Nicolas Mariot (Standard support level)
Joined: 02/28/2016
Posts: 10

Yes I have a small application that can reproduce the issue and I can send it to you.

Nicolas
#36265
Posted: 03/18/2016 12:21:03
by Eugene Mayevski (Team)

Wonderful, thank you. I have created a HelpDesk (URL: https://www.eldos.com/helpdesk/ ) ticket for you where you can pass the test application.


Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

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