EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Socket SSL

Posted: 10/26/2012 08:12:43
by Sergio Santiago (Basic support level)
Joined: 10/26/2012
Posts: 3

I've been developing an application using Silverlight 5, and I'm stuck trying to find a way to implement a SSL Socket over TCP connection.
Is there any sample using SBB to build this?
I've already implemented an asynchronous socket in my application, and now I have something like, my method write which receive an object with the information that I need to send over the socket. My method read these information, serialize them using my own protocol, returning a byte array which will be send through the socket. I would like to be able to insert the SSL layer between the serializer and the written process without any changes in my logical protocol processor.

Is it possible with SBB?
Posted: 10/26/2012 08:18:31
by Eugene Mayevski (Team)

You can either use TElSSLClient component for SSL layer on existing socket implementation, or you can use TElSimpleSSLClient class which includes a socket and SSL layer and works in synchronous mode.

Use of both components is shown in various samples which can be found in <SecureBlackbox>\Samples\<language>\SSLBlackbox folder . Samples are for desktop .NET, but you can easily adapt them for Silverlight - with TElSimpleSSLClient everything is straightforward and TElSSLClient component needs understanding in any case (i.e. for both desktop and silverlight development).

Sincerely yours
Eugene Mayevski
Posted: 10/26/2012 08:32:23
by Sergio Santiago (Basic support level)
Joined: 10/26/2012
Posts: 3

Thank you for your reply.
I ll try it!

Posted: 10/29/2012 16:41:57
by Sergio Santiago (Basic support level)
Joined: 10/26/2012
Posts: 3

Eugene, I'm back!

I'd followed your suggestion and used TElSSLClient in my existing socket to implements the SSL Socket Layer.
Everything was nice, until the moment when I've pressed play in my VS. When my application tried to create an instance of TElSSLClient, I got the error:

System.MethodAccessException: Attempt by security transparent method 'SBCryptoProvWin32.TElWin32ProviderInfo.AcquireProvider()' to call native code through method 'SBWinCrypt.__Global.CryptAcquireContext(UInt32 ByRef, System.String, System.String, UInt32, UInt32)' failed. Methods must be security critical or security safe-critical to call native code.

I've tried to add the tag [SecurityCritical] before my method (Which is my object's constructor), but with no success.

I'm following an exactly implementation provided in sample's folder:

Below there is a piece of code, where I'm getting the error:
public SslSocketClient(IMessageSerializer messageSerializer)
            : base(messageSerializer)
            _encodedBuffer = new List<byte>();
            _secureClient = new TElSSLClient
                                       Versions = SBSSLConstants.__Global.sbTLS1,
                                       Enabled = true

            _secureClient.OnOpenConnection += SecureClientOpenConnection;
            _secureClient.OnCloseConnection += SecureClientCloseConnection;
            _secureClient.OnData += SecureClientOnData;
            _secureClient.OnSend += SecureClientSend;
            _secureClient.OnReceive += SecureClientReceive;
            _secureClient.OnCertificateNeeded += SecureClientCertificateNeeded;
            _secureClient.OnCertificateValidate += SecureClientCertificateValidate;

Any ideas?


Sergio Santiago
Posted: 10/30/2012 01:59:41
by Eugene Mayevski (Team)

There's build 227 on the site, it should address this problem. If it doesn't, please pack your source code and project files (.csproj) and post them to HelpDesk for investigation - the issue seems to have something with project settings and silverlight policies.

Sincerely yours
Eugene Mayevski
Posted: 10/30/2012 10:51:29
by Eugene Mayevski (Team)

Developers have reproduced the problem locally (at least with build 226) and are looking into it now.

Sincerely yours
Eugene Mayevski



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