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.

Add a Comment

Replies

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
  • No matter if this is working or not, like Quinn mentioned above, you should migrate to a local network name instead of using IP, and also move away from using UIWebView because it is deprecated.

Add a Comment