Hello
We use REST API communication for client-server communication assuming a local network connection.
Verification of international SSL server certificates for https communication is necessary when accessing public external servers
If you are using it to connect on a local network, you can skip the SSL server certificate verification process.
Is this usage contrary to Apple's policy?
If you do make a prediction, is there any other way other than "verifying" it?
[reference]
1 Client side terminal (Windows, Mac, iOS, Android)
2 Server-side equipment (image creation equipment such as network-connectable MFPs and printers)
1 and 2 are connected in the same local network and exchange data using REST API communication.
[Actual processing]
NSURLSessionAuthChallengeDisposition disposition,
NSURLCredential *credential))completionHandler {
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
// init trush obj
SecTrustRef serverTrust = challenge.protectionSpace.serverTrust;
// set trush ssl
SecTrustResultType result;
SecTrustEvaluate(serverTrust, &result);
NSURLCredential *credential = [NSURLCredential credentialForTrust:serverInstruction];
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
} else {
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
}
}