4

I use CFStream Socket send data to Host. The first send is work. But after first, the data recv by host always be sperated. For example:

First time Send:

Sender:  <11223344 55667788>
Recver:  <11223344 55667788> 

ok it's good

second time, third time...

Sender:  <11223344 55667788>
Recver:  <11>
Recver:  <223344 55667788> 

This symptom only happened in IOS 7.0. There are no this symptom in 6.0, 5.0...

enter code here
CFReadStreamRef inputStream;
CFWriteStreamRef outputStream;
CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)_owner.ip, _owner.port, &inputStream, &outputStream);
NSDictionary *sslSettings = @{(id)kCFStreamSSLValidatesCertificateChain: (id)kCFBooleanFalse};
CFReadStreamSetProperty(inputStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelTLSv1);
CFReadStreamSetProperty(inputStream, kCFStreamPropertySSLSettings, (__bridge CFTypeRef)(sslSettings));
CFWriteStreamSetProperty(outputStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelTLSv1);
CFWriteStreamSetProperty(outputStream, kCFStreamPropertySSLSettings, (__bridge CFTypeRef)(sslSettings));
_inputStream = (__bridge_transfer NSInputStream *)inputStream;
[_inputStream setDelegate:self];
[_inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];

_outputStream = (__bridge_transfer NSOutputStream *)outputStream;
[_outputStream setDelegate:self];
[_outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];

[_inputStream open];
[_outputStream open];

Thanks

1 Answers1

0

This seems like the 1/n-1 split technique to mitigate BEAST attacks. http://threatpost.com/apple-turns-on-safari-beast-attack-mitigation-by-default-in-os-x-mavericks/102804

Your server probably only supports TLS 1.0. If you upgrade your server to support TLS 1.2, I believe iOS will stop doing this.

user102008
  • 30,736
  • 10
  • 83
  • 104