我有一个 iOS 配置文件,上面配置了 IPSec VPN。OnDemand 选项在 iOS8 上效果很好。
在 iOS9 上测试配置文件(为即将发布的版本做好准备)时,我遇到了 OnDemand 配置问题。当我尝试访问 safari 上的某些域时,它根本无法连接。手动连接到 VPN 确实有效
这是我的 mobileconfig 的按需部分:
<key>IPSec</key>
<dict>
<key>AuthenticationMethod</key>
<string>Certificate</string>
<key>OnDemandEnabled</key>
<integer>1</integer>
<key>OnDemandRules</key>
<array>
<dict>
<key>Action</key>
<string>EvaluateConnection</string>
<key>ActionParameters</key>
<array>
<dict>
<key>Domains</key>
<array>
<string>duckduckgo.com</string>
</array>
<key>DomainAction</key>
<string>ConnectIfNeeded</string>
<key>RequiredURLStringProbe</key>
<string>https://vpn.test.mydomain.com</string>
</dict>
</array>
</dict>
</array>
....
....
在为 iOS9 尝试了很多配置之后,我还设法让 VPN 始终连接 OnDemand,除了配置文件安装之外没有任何操作,但这不是我想要的行为。
这是始终允许按需的配置:
<key>IPSec</key>
<dict>
<key>AuthenticationMethod</key>
<string>Certificate</string>
<key>OnDemandEnabled</key>
<integer>1</integer>
<key>OnDemandRules</key>
<array>
<dict>
<key>Action</key>
<string>Connect</string>
<key>ActionParameters</key>
<array>
<dict>
<key>Domains</key>
<array>
<string>duckduckgo.com</string>
</array>
<key>DomainAction</key>
<string>ConnectIfNeeded</string>
<key>RequiredURLStringProbe</key>
<string>https://vpn.test.mydomain.com<</string>
</dict>
</array>
</dict>
</array>
我认为这是因为“action”键的“connect”值不检查 ActionParameters,只是自动连接到 VPN 服务器。
我希望我错过了一些苹果尚未在其官方文档中更新的新功能。
任何修复 iOS9 配置文件的建议将不胜感激。谢谢。