Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8036103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:30:39+00:00 2026-06-05T02:30:39+00:00

My iOS app contains 2 versions: server and client. Server posts a service via

  • 0

My iOS app contains 2 versions: server and client. Server posts a service via Bonjour and waits for a client. Client searches that services and connects to the server. After that all communications implemented through CFSockets.
Here is my code to set up streams for such communications:

- (BOOL)setupSocketStreams {
if ( readStream == nil || writeStream == nil ) {
    return NO;
}
incomingDataBuffer = [[NSMutableData alloc] init];
outgoingDataBuffer = [[NSMutableData alloc] init];

// Turning SSL on
NSDictionary *sslSettings = [NSDictionary dictionaryWithObjectsAndKeys:(id)kCFBooleanFalse, (id)kCFStreamSSLValidatesCertificateChain, nil];
CFReadStreamSetProperty(readStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
CFReadStreamSetProperty(readStream, kCFStreamPropertySSLSettings, sslSettings);
CFWriteStreamSetProperty(writeStream, kCFStreamPropertySocketSecurityLevel, kCFStreamSocketSecurityLevelNegotiatedSSL);
CFWriteStreamSetProperty(writeStream, kCFStreamPropertySSLSettings, sslSettings);

CFReadStreamSetProperty(
        readStream,
        kCFStreamPropertyShouldCloseNativeSocket,
        kCFBooleanTrue
);
CFWriteStreamSetProperty(
        writeStream,
        kCFStreamPropertyShouldCloseNativeSocket,
        kCFBooleanTrue
);

CFOptionFlags registeredEvents =
        kCFStreamEventOpenCompleted     |
                kCFStreamEventHasBytesAvailable |
                kCFStreamEventCanAcceptBytes    |
                kCFStreamEventEndEncountered    |
                kCFStreamEventErrorOccurred
;

CFStreamClientContext ctx = {
        0,      // version
        self,   // info
        NULL,   // retain callback
        NULL,   // release callback
        NULL    // copyDescription callback
};

CFReadStreamSetClient(
        readStream,
        registeredEvents,
        readStreamEventHandler,
        &ctx
);
CFWriteStreamSetClient(
        writeStream,
        registeredEvents,
        writeStreamEventHandler,
        &ctx
);

CFReadStreamScheduleWithRunLoop(
        readStream,
        CFRunLoopGetCurrent(),
        kCFRunLoopCommonModes
);
CFWriteStreamScheduleWithRunLoop(
        writeStream,
        CFRunLoopGetCurrent(),
        kCFRunLoopCommonModes
);

if ( ! CFReadStreamOpen(readStream) || ! CFWriteStreamOpen(writeStream)) {
    [self close];
    return NO;
}

if ([self.delegate respondsToSelector:@selector(establishedConnection:)]) {
    [self.delegate establishedConnection:self];
}

return YES;
}

Without part that turning SSL on this code works fine, but otherwise I’m getting error:

Error:
The operation couldn’t be completed. (OSStatus error -9800.)

What kind of problem can it be?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:30:42+00:00Added an answer on June 5, 2026 at 2:30 am

    There is a known issue for TLS1.2 support in iOS 5: https://developer.apple.com/library/ios/#technotes/tn2287/_index.html#//apple_ref/doc/uid/DTS40011309

    By setting kCFStreamSSLLevel to @”kCFStreamSocketSecurityLevelTLSv1_0SSLv3″ I was able to fix the -9800 issue in my app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i´ve just created an iOS app that contains lots of media. Now i just
I have an iOS app that contains a lot of local web content. Some
We have an iOS app that publishes certain activity to Facebook that contains links
I've got an iOS app that I need to write an API for, and
I'm making an iOS app like Kik messenger. I'm worried that the chat will
I have an iPhone (iOS) app that keeps data in a local SQLite database
In my current iOS application I created a ResourceDoc folder that contains some initial
I currently have an iOS app that allows people to submit content to our
I have create an IOS app. The app has MainViewController that will present/dismiss Modal
I have an app that contains a sequence of listviews, and those lists are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.