Packet CFStream Socket sends packet not completed in iOS 7.0

I use CFStream Socket to send data to Host. First gear is work. But, firstly, recv data is always detached from the host. For instance:

First time Submit:

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

Good good

second time, third time ...

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

This symptom occurred only in iOS 7.0. There is 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

+4
source share
1 answer

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

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

0
source

All Articles