iOS NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

11,460

Your server is not set up correctly. While it probably has a properly signed certificate it is missing the chain certificates leading to the trusted root. See the problems reported by SSLLabs analysis about additional certificates and the certification path.

How to configure these missing intermediate certificates depends on your server. For more information see Godaddy support site.

Share:
11,460
Mike Simz
Author by

Mike Simz

iOS Developer @ Code4Armour Inc. (Toronto, ON): www.code4armour.com Indie iOS Games Developer: Rock Toss - Animal Flick - Celebrity Skulls - Celebrity Mashup - Last Assassin - Mole Smasher

Updated on July 27, 2022

Comments

  • Mike Simz
    Mike Simz almost 2 years

    I am getting this error whenever I try making a request to our server. It was working fine before we setup SSL, not it is all messed up..here is my code:

      // Setup URL POST Request..
    NSString* code4ArmourUrl = [NSString stringWithFormat:@"https://api.code4armour.com/index.php/user/login?"];
    
    NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:code4ArmourUrl ]];
    [request setHTTPMethod:@"POST"];
    [request addValue:@"00000000000000000000000000000000" forHTTPHeaderField:@"X-api-key"];
    
    NSString* postString = [NSString stringWithFormat:@"email=%@&password=%@",emailString,passwordString];
    postString = [postString stringByReplacingOccurrencesOfString:@"+" withString:@"%2b"];
    
    [request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];
    
    
    // Make URL POST Request..
    [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError* connectionError) {
    

    Any reason why this isn't working..I believe it is an issue with SSL but I don't know how to get around this without doing something hacky that Apple won't end up accepting on to the App Store?

    Any help would be greatly appreciated! Thanks.