【问题标题】:iOS 7 programatically per app VPNiOS 7 以编程方式每个应用程序 VPN
【发布时间】:2013-09-28 11:26:24
【问题描述】:

我正在开发一个 iOS 7 应用程序,我想知道是否“手动”激活了“Per app VPN”功能(例如位置服务,您可以在其中选择可以和不可以的应用程序)或者我可以在应用内通过代码设置吗?

在网上我发现关于它的信息很少,苹果公告也没有说清楚......我希望在用户第一次打开应用程序时提示用户进行VPN配置,然后,当他在“外部”内部 Wi-Fi,我会自动激活它...

【问题讨论】:

标签: ios ios7 vpn


【解决方案1】:

信息仍然有些粗略,但据我所知,到目前为止,VPN 供应商需要支持它,它将使用配置文件启用,例如通过 MDM。在配置文件中,您将像现在一样定义您的 VPN 配置,此外,您将指定哪些应用程序使用哪些 VPN 配置。应用程序根本不需要修改,(我假设)甚至都不知道它们正在被隧道化。我还不知道他们是否允许用户在没有配置配置文件的情况下自行配置。我不明白为什么不这样做,除了可能想让普通用户免受“企业”功能的影响。

我希望 Apple 会发布新版本的 iPhone 配置实用程序或 Apple Configurator,让您可以设置所有这些。如果您可以访问他们的开发人员站点,则配置文件中的 XML 密钥信息会打开它,因此您可以在没有该工具的情况下自行制作配置文件,但如果没有 VPN 供应商支持,您将无法做到去做。不知道目前有没有内置的VPN支持。

【讨论】:

    【解决方案2】:

    *注意:这是一个示例自定义负载。它需要修改以匹配您的 VPN 配置,并且受某些 VPN 提供商的支持。此示例使用 L2TP 连接类型。 Per-App VPN 的新密钥是 VPNUUID 和 OnDemandMatchAppEnabled。

    <dict>
        <key>PayloadDescription</key>
        <string>Configures VPN settings, including authentication.</string>
        <key>PayloadDisplayName</key>
        <string>VPN (VPN Configuration)</string>
        <key>PayloadIdentifier</key>
        <string>126b636d-38ce-4bb1-a211-5239e60bd4ab</string>
        <key>PayloadOrganization</key>
        <string></string>
        <key>PayloadType</key>
        <string>com.apple.vpn.managed.applayer</string>
        <key>PayloadUUID</key>
        <string>63e3f54a-e8bd-45fd-af18-5aadfed9dc9d</string>
        <key>PayloadVersion</key>
        <integer>1</integer>
        <key>UserDefinedName</key>
        <string>VPN Configuration #12345</string>
        <key>VPNUUID</key>
        <string>b78ee624-442d-4997-a77f-dc8245109716</string>
        <key>OnDemandMatchAppEnabled</key>
        <string>True</string>
        <key>VPNType</key>
        <string>L2TP</string>
        <key>EAP</key>
        <dict />
        <key>IPv4</key>
        <dict>
          <key>OverridePrimary</key>
          <integer>0</integer>
        </dict>
        <key>PPP</key>
        <dict>
          <key>CommRemoteAddress</key>
          <string>ExampleServerHostname</string>
          <key>CCPEnabled</key>
          <integer>1</integer>
        </dict>
        <key>Proxies</key>
        <dict />
      </dict>
    

    更多信息请访问:https://developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html

    【讨论】:

    • 我从哪里得到 VPNUUID?
    • 对于 Safari 域,我收到错误消息“MKBDeviceLockAssertion: MKBDeviceLockAssertion (asserttype:3) (Error) MC: could not add Safari App VPN rules”
    • Per app VPN 仅允许用于 VPNType "VPN"。不是“L2TP”。这行不通。
    猜你喜欢
    • 2015-05-15
    • 1970-01-01
    • 2012-07-17
    • 2018-01-29
    • 2015-01-01
    • 2015-06-28
    • 1970-01-01
    • 2015-10-21
    • 2012-09-01
    相关资源
    最近更新 更多