Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

SSL Error in IOS app using HTTPS Server

We have an ios app (built using cordova) which is using our HTTPS Server for login and fetching information, in the development environment

we are getting SSL error so we have tried step 1) below and it works.

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

Workaround

1) Added logic to bypass SSLError in iOS:~ AppDelegate.m

@implementationNSURLRequest(DataController)

+(BOOL)allowsAnyHTTPSCertificateForHost: (NSString*)host{

return YES;

}

@end

2) Now we want to submit the app in app store and we saw in various forums that we need to remove the above Step 1) before submitting the app otherwise it will be Rejected.

1st Solution Tried~

We have tried the below codes- A & B in MYAPP-Info.plist in our dev env by removing step 1) from code but it didn't worked.

Code A)

<key>NSAppTransportSecurity</key>

<dict>

 <key>NSAllowsArbitraryLoads</key>

<true/>

</dict>

Code B)

<key>NSAppTransportSecurity</key>

 <dict><key>NSExceptionDomains</key>

 <dict><key>OUR_HTTPS_URL</key>

 <dict><key>NSIncludesSubdomains</key><true/>

 <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key><true/>

 <key>NSTemporaryExceptionMinimumTLSVersion</key>

 <string>TLSv1.1</string>

 </dict>
</dict></dict>

...

Now the question is~

A) If we just remove the step 1) will the app submission works or it will be failed.?

B) If by removing step 1) app submission failed, what will be the solution to fix this problem so that app will be successfully submitted on app store.?


2nd Solutions Tried:-

We have tried selective bypass but don't know if it works or not, if we use below code its working at our local environment, so this solution is accepted by apple or we have to try something else (please suggest).

@implementation NSURLRequest(DataController)

+(BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host{

if([host isEqualToString:@"OUR_HOST_NAME"])

{

return YES;



}else

{

return FALSE;

}

}

@end

iPhone 6, iOS 8.3, null

Posted on Mar 21, 2016 6:25 PM

Reply

There are no replies.

SSL Error in IOS app using HTTPS Server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.