NSURLErrorDomain Code=-1003 ... again!

This happens when trying to connect to my development web server. The app works fine when connecting to my production server.

The production server has a certificate purchased from a CA. My development web server has a locally generated certificate (from mkcert).

  1. I have dragged and dropped the rootCA.pem onto the Simulator, although it doesn't indicate it has been loaded the certificate does appear in the Settings app and is checked to be trusted.

  2. I have enabled "App Sandbox" and "Outgoing connections (Client)".

  3. I have tested the URL from my local browser which is working fine.

What am I missing?

Answered by DTS Engineer in 849476022

Yeah, App Sandbox is a macOS technology. iOS apps are always sandboxed. The underlying technology is the same, but there are significant differences in practice, and hence the Mac-specific term.

Didn’t we drive this to a conclusion in your previous thread? What’s changed since then?

Oh, one thing that has changed is that the simulator is having problems local network operations. See this thread. See TN3179 Understanding local network privacy for a definition of a local network operations. Unless you fancy upgrading to macOS 15.6 beta, it’s best to test this stuff on a real device.

Share and Enjoy

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

Helllooooo??? Is anybody out there?

I'm on xcode 16.3 trying to develop in Swift for minimum compatibility iOS 15, but I'm stuck setting up my development environment.

Can I get some help please? All suggestions welcome.

Sorry I didn’t respond earlier. You originally put your question in the Safari & Web topic, which isn’t something I monitor. But the content of your post confirms you’re building a native app, which is something I can help with.

Reading through your original post, I’d like to clarify your setup. In point 1 you talk about the simulator, which suggests you’re building an iOS app. In point 2 you talk about the App Sandbox, which suggests you’re building a macOS app. Which is it?

Share and Enjoy

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

Hi Quinn

Definitely an iOS app. When googling this error I came across some answers that suggested enabling the Outgoing Connections in the App sandbox. I found these settings (including an App Sandbox) in the app configuration stuff. I wasn't aware that it only applies to OSX.

Cheers Murray

Accepted Answer

Yeah, App Sandbox is a macOS technology. iOS apps are always sandboxed. The underlying technology is the same, but there are significant differences in practice, and hence the Mac-specific term.

Didn’t we drive this to a conclusion in your previous thread? What’s changed since then?

Oh, one thing that has changed is that the simulator is having problems local network operations. See this thread. See TN3179 Understanding local network privacy for a definition of a local network operations. Unless you fancy upgrading to macOS 15.6 beta, it’s best to test this stuff on a real device.

Share and Enjoy

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

@DTS Engineer You have a good memory. Yes, I had similar problems with my previous MBP setup, however with your help we did manage to get it working.

This time I tried over and over to drop the certificate on the simulator, and when I checked the Settings the trusted certificate appeared to be in place. However, when I tried it I continued to get this error.

I might give the macOS beta a try over the weekend. Testing with a real device takes so much longer, having to commit and push code to external servers. It's a painful work around.

Cheers Murray

The Sequoia beta 3 is working! And a bonus, it didn't break my local web server setup!!

Thanks @DTS Engineer Please ask the developers not to break it again.

NSURLErrorDomain Code=-1003 ... again!
 
 
Q