Web navigation with self-signed certificate from a local server

Hi,

Can I connect with a local server with self-signed cert that support the 2019 requirements? (https://support.apple.com/en-us/HT210176)

The app loads content on UIWebView from a local server, like 192.168.1.50 for example, with self-signed cert.

I have tried without success:

  1. Install the custom CA in iOS (Settings -> General -> Profile)

  2. Set into Info.plist the following configs:

  • Allow Arbitrary Loads: YES
  • Allow Arbitrary Loads: NO; Exception Domains: 192.168.1.50:8080; Allow Arbitrary Loads in Web Content: YES;
  • Allow Arbitrary Loads: YES; Allow Arbitrary Loads in Web Content: YES; Allows Local Networking: YES
  • Allow Arbitrary Loads: NO; Exception Domains: 192.168.1.50:8080; Allow Arbitrary Loads in Web Content: YES; Allows Local Networking: YES

Is it possible works as I pretend? Load web content in a UIWebView from a local server with self-signed certificate?

Please, some help for that.

Thank you in advance.

I have following the next guide to generate the root ca (to install on iPhone) and the cert and key for the server using the previously root ca (https://developer.apple.com/library/archive/technotes/tn2326/_index.html#//apple_ref/doc/uid/DTS40014136-CH1-SECISSUE_C), this guide was recovered from a similar thread: https://developer.apple.com/library/archive/qa/qa1948/_index.html but that server were online, and my server is on LAN.

Three things…

With regards your first step, make sure that you’ve enabled the root certificate in Settings > General > About > Certificate Trust Settings. See QA1948 HTTPS and Test Servers.

With regards your second step, none of that should be necessary if you get the CA’s root installed properly.

You wrote:

like 192.168.1.50 for example

I strongly recommend against using IP addresses here. Instead use your servers .local name.

ps You wrote:

The app loads content on UIWebView

UIWebView has been deprecated for many years now. Please switch to WKWebView.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I have tried to repeat the previous steps with a new Ionic app opening the local URL in inAppBrowser window and works fine. The context is like follow:

  1. Ionic app opening local URL with "_blank" format, ie, showing in-app browser window
  2. The root CA was installed on iOS and accepted as Trust CA
Web navigation with self-signed certificate from a local server
 
 
Q