SSL Binary client Handler

22 views
Skip to first unread message

Satish Singh

unread,
Jul 11, 2014, 5:06:25 AM7/11/14
to quick...@googlegroups.com
I am having trouble in recieving binary data. If i
send 4 byte data it is split into two chunks (1byte & 3byte). This is occuring in ClientBinaryHandler
( QuickAuthenticationHandler works good ) when using
in secure ssl mode. log is show below.

send: 4B - Raw: data

recieved: 1B - Raw: d
recieved: 3B - Raw: ata

Akshath

unread,
Jul 12, 2014, 6:03:22 AM7/12/14
to quick...@googlegroups.com
This happens in TCP/IP.. the packets may be broken up.

If you use Byte or Binary Mode for input then you must have logic in your code to take care of split packets..; in Byte mode there is no request separator that would be configured in QuickServer.. so the server will pass the data as they arrive over network.

one possible way:
If you have not got all the data (this can happen.. since tcp can break up packets).. you save what you have got into ClientData and return and wait for next packet. Then add it to the existing data in ClientData and then process. Check XmlAdder example to see how this could be done..  

Satish Singh

unread,
Jul 12, 2014, 2:10:24 PM7/12/14
to quick...@googlegroups.com
hank you for idea. I have implemented that approach. its working good.
But I think there is something strange with binary client handler.
1) Only occurs in secure mode. Its gone when connected in non-secure mode.
2) Happens only in client binary handler while QuickAuthenticator receives data in one call.
3) Data is always split in first 1byte and next the remaining part.

May be its TLS behavior. I m not an expert. So I m good as long as I can work with it. And Thanks for your reply.

Akshath

unread,
Jul 15, 2014, 12:37:16 AM7/15/14
to quick...@googlegroups.com
Here are some possible explanations for the same..

1) Only occurs in secure mode. Its gone when connected in non-secure mode.
=> This is because of the additional data that are generated & transmitted part of SSL/TLS
 
2) Happens only in client binary handler while QuickAuthenticator receives data in one call. 
=> Chance of this happening in the first call is high in secure mode due to SSL/TLS key exchange

3) Data is always split in first 1byte and next the remaining part. 
=> This depends on the network & os you are operating on
Reply all
Reply to author
Forward
0 new messages