EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Windows Phone sample?

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#20599
Posted: 06/24/2012 07:20:26
by Eugene Mayevski (EldoS Corp.)

Next, if you handle OnCertificateValidate event right and connection still does not happen, handle OnError event and inspect values present there. You might need to experiment with SSL/TLS version and used cipher suites.


Sincerely yours
Eugene Mayevski
#20600
Posted: 06/24/2012 10:53:51
by Alex Lourenco (Basic support level)
Joined: 06/23/2012
Posts: 8

Thanks for the tips, I really appreciate it.

I was able to get it working nicely with the TElSimpleSSLClient but since it is causes thread block and I'd rather keep my async design in the phone, I've attempted to do the same thing with TElSecureClient.

It starts the connection to the server (at least the TLS 1.2 handshake - which has been set on both the server and the client), but then the client only gets back 2 bytes from that process and eventually it leads to a 75777 error.
I have searched through the forum and this error relates to lacking of TLS on the server side (Unknowen Message), yet it there and if I use the Client Sample and connect to it, it works flawless.

(The only thing i can think of is miss pacing the TElSecureClient calls since the aync sockets are handled differently on the phone)
#20601
Posted: 06/24/2012 11:16:57
by Eugene Mayevski (EldoS Corp.)

Use of TElSecureClient requires understanding of its asynchronous nature. However, the component itself is not multithreaded and in async implementation of Silverlight and Windows Phone sockets this can cause certain troubles when used wrong.

The best you can do is download SecureBlackbox 10 beta and look at the source code of SSLSocket class (it's available in <SecureBlackbox>\Classes folder in SBB 10 installation). There TElSecureClient (in SBB 10 it's named TElSSLClient) is optionally used with asynchronous mode of Socket class of .NET Framework. While that asynchronous mode is different from Silverlight ones, the idea of using TElSecureClient in async mode is the same.


Sincerely yours
Eugene Mayevski
#20604
Posted: 06/25/2012 08:39:43
by Alex Lourenco (Basic support level)
Joined: 06/23/2012
Posts: 8

Thank you Eugene,

I looked through the source and tried to do something of the sort but the implementation seems to be rather problematic because of windows sockets.

I'm thinking about just sticking with a TElSimpleSSLClient in a dedicated thread, which leads me to another problem.

The Client is able to connect to the server, I am to send about 2 different packets (login and retrieval of information). Once I get to another stage I send a packet to the server and while reading the response (which is fully retrieved successfully) the client throws a 75778 error.

I look around and read several places that this is usually caused by TLS so I have tried TLS 1.2/1.1/1.0 and SSL 3.0. All end up generating the same error (I know for sure that the problem resides on the phone client since it says remote false and remote true in the server side).

Any idea what could cause this? (I have also tried changing cyphers, doesnt seem to have anything to do)
#20606
Posted: 06/25/2012 09:21:19
by Eugene Mayevski (EldoS Corp.)

1) What server are you using?

2) Try doing the same on desktop (with desktop assemblies) - does the same problem happen?


Sincerely yours
Eugene Mayevski
#20607
Posted: 06/25/2012 09:31:27
by Alex Lourenco (Basic support level)
Joined: 06/23/2012
Posts: 8

I will try with a desktop application and report back!

As for the server I am using a ElServerSSLSocket to handle everything.
#20615
Posted: 06/26/2012 07:33:40
by Alex Lourenco (Basic support level)
Joined: 06/23/2012
Posts: 8

I was able to fix the error, basically I blocked the Thread with a ReceiveData, which would then prevent the socket from communicating and end up with that error, this causes me a drawback as I have a requirement that when 2 clients are connected to the server, if one generates a QRCode and the other clients reads it, the server notifies the client that has got his barcode read.

I am having trouble solving this with this synchronized model =/ Any tips on this?
I understand is kind of a vague question and not really related to secure box per say.
#20617
Posted: 06/26/2012 08:09:17
by Vsevolod Ievgiienko (EldoS Corp.)

Actually its hard to help without having a full understanding of the project you're trying to implement.

Quote
I was able to fix the error, basically I blocked the Thread with a ReceiveData

In general you can call TElSimpleSSLClient.CanReceive() to check if there is any data received from a server and then call TElSimpleSSLClient.ReceiveData().
#20618
Posted: 06/26/2012 08:13:16
by Eugene Mayevski (EldoS Corp.)

Well, servers are better created asynchronous, so you would need to review how TElSecureServer (TElSSLServer in SBB 10) is used in SSLSocket class (which I mentioned before) and in samples.


Sincerely yours
Eugene Mayevski
#20619
Posted: 06/26/2012 08:24:35
by Alex Lourenco (Basic support level)
Joined: 06/23/2012
Posts: 8

Quote
Vsevolod Ievgiienko wrote:
Actually its hard to help without having a full understanding of the project you're trying to implement.

Quote
I was able to fix the error, basically I blocked the Thread with a ReceiveData

In general you can call TElSimpleSSLClient.CanReceive() to check if there is any data received from a server and then call TElSimpleSSLClient.ReceiveData().


#######

I will give a try to CanReceive.

Quote
Eugene Mayevski wrote:
Well, servers are better created asynchronous, so you would need to review how TElSecureServer (TElSSLServer in SBB 10) is used in SSLSocket class (which I mentioned before) and in samples.


Yeah the server is fully async, the problem is mainly on the client (Phone) side.
I am able to notify the client who scans the data (which makes the server request) but not the client who was providing the data(which ends in a timeout if I try to force it to wait for receiving data).

Anyways, I will give it a try to report.

Thanks you very much to both of you for the support.

EDIT: CanReceive seems to work perfectly with my design approach!
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.

Reply

Statistics

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