To rule out configuration / server issue, I first created a VPN profile and tried connecting to the VPN using it. I'm able to connect to the VPN using the VPN Profile.
Excellent news. Getting a configuration profile working is an important first step.
However, when trying out through code, I get an error …
There are two common causes of problems like this:
Server trust evaluation
Keychain
I’ll discuss each in turn below.
With regards server trust evaluation, does you configuration profile contain a root certificate (
com.apple.security.root
) payload? If so, remove that payload and see if it still connects. If it doesn’t, you have server trust evaluation problems.
Personal VPN does not let you customise server trust evaluation. If you want your server to work with Personal VPN, you’ll have to get it a system-trusted certificate.
When putting credentials in the keychain, it’s easy to get confused. I posted some code showing how to do this on this thread. I recommend that you use that code to set up your keychain items.
If neither of these suggestions pan out, open a DTS tech support incident and I’ll take an in-depth look at your issue in that context.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"