在iOS SDK中安装MDM iPCU配置文件失败

在iOS SDK中安装MDM iPCU配置文件失败,ios,objective-c,iphone,ssl,mdm,Ios,Objective C,Iphone,Ssl,Mdm,我正在做一个MDM供应商设置,并让apple enterprise帐户进行同样的设置。但在完成所有步骤后,我在尝试在iPhone上安装iPhone配置实用程序文件时遇到了问题。我们收到一条警告,说“配置文件安装失败”。请指出您怀疑的错误。以下是我创建个人资料时遵循的步骤 对于供应商: 我在macbook上创建了名为vendor.csr的供应商csr 电子邮件:我的企业帐户电子邮件 通用名称:我的公司名称 保存到磁盘 将vendor.csr文件上载到企业帐户,并从该帐户下载mdm.cer文件 已将

我正在做一个MDM供应商设置,并让apple enterprise帐户进行同样的设置。但在完成所有步骤后,我在尝试在iPhone上安装iPhone配置实用程序文件时遇到了问题。我们收到一条警告,说“配置文件安装失败”。请指出您怀疑的错误。以下是我创建个人资料时遵循的步骤

对于供应商:

  • 我在macbook上创建了名为
    vendor.csr
    的供应商csr

    电子邮件:我的企业帐户电子邮件

    通用名称:我的公司名称

    保存到磁盘

  • vendor.csr
    文件上载到企业帐户,并从该帐户下载
    mdm.cer
    文件

  • 已将此证书加载到密钥链

  • 将.p12文件导出为
    private.p12
    文件

  • 使用以下命令提取私钥:
    openssl pkcs12-in Private.p12-nocerts-out key.pem

  • 提取的证书:
    openssl pkcs12-in private.p12-clcerts-nokeys-out cert.pem

  • 将证书转换为des格式:
    openssl x509-in cert.pem-通知pem-out mdm.cer-输出des

  • 8.从私钥中删除密码:
    openssl rsa-in-key.pem-out private.key

    对于客户:

  • 现在,我从同一台macbook为push创建了另一个csr,名为push.csr

    电子邮件:公司支持电子邮件

    通用名称:公司名称推送

    保存到磁盘

  • Python代码:

    链接:

    我从上面的链接获得python代码,从上面生成的文件中获得plist编码文件,即
    private.key、push.csr、mdm.cer
    。我根据下面的命令重命名了我的文件,并生成了plist编码文件

    命令:
    python mdm\u vendor\u sign.py--csr user\u submitted\u csr.csr--key mdm\u vendor\u private.key--mdm mdm\u certifiate\u from_apple.cer

    推送证书:

    Nov 27 19:02:21 iPhone profiled[114] <Notice>: (Note ) MC: Checking for MDM installation...
    
    Nov 27 19:02:21 iPhone profiled[114] <Notice>: (Note ) MC: ...finished checking for MDM installation.
    
    Nov 27 19:02:21 iPhone profiled[114] <Notice>: (Note ) MC: Beginning profile installation...
    
    Nov 27 19:02:21 iPhone profiled[114] <Error>:  SecTrustEvaluate  [leaf AnchorTrusted]
    
    Nov 27 19:02:23 iPhone locationd[63] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
    
    Nov 27 19:02:24 iPhone locationd[63] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
    
    Nov 27 19:02:24 iPhone profiled[114] <Error>:  SecTrustEvaluate  [leaf AnchorTrusted]
    
    Nov 27 19:02:26 iPhone profiled[114] <Notice>: (Error) MDM: Cannot Authenticate. Error: NSError:
    
    Desc   : A connection to the server could not be established.
    
    US Desc: A connection to the server could not be established.
    
    Domain : MCHTTPTransactionErrorDomain
    
    Code   : 23001
    
    Type   : MCFatalError
    
    Params : (
    
        "https://mdm.myCompanyName.com/Service1.svc",
    
        500
    
    )
    
    Nov 27 19:02:26 iPhone profiled[114] <Notice>: (Error) MC: Cannot install MDM “Mobile Device Management”. Error: NSError:
    
    Desc   : The payload “Mobile Device Management” could not be installed.
    
    Sugg   : A connection to the server could not be established.
    
    US Desc: The payload “Mobile Device Management” could not be installed.
    
    US Sugg: A connection to the server could not be established.
    
    Domain : MCInstallationErrorDomain
    
    Code   : 4001
    
    Type   : MCFatalError
    
    Params : (
    
        "Mobile Device Management"
    
    )
    
    ...Underlying error:
    
    NSError:
    
    Desc   : A connection to the server could not be established.
    
    US Desc: A connection to the server could not be established.
    
    Domain : MCHTTPTransactionErrorDomain
    
    Code   : 23001
    
    Type   : MCFatalError
    
    Params : (
    
        "https://mdm.myCompanyName.com/Service1.svc",
    
        500
    
    )
    
    Nov 27 19:02:26 iPhone profiled[114] <Notice>: (Error) MC: Rolling back installation of profile “com.myCompanyName.mdm.profile”...
    
    Nov 27 19:02:26 iPhone profiled[114] <Notice>: (Error) MC: Installation of profile “com.myCompanyName.mdm.profile” failed with error: NSError:
    
    Desc   : The profile “myCompanyName” could not be installed.
    
    Sugg   : The payload “Mobile Device Management” could not be installed.
    
    US Desc: The profile “myCompanyName” could not be installed.
    
    US Sugg: The payload “Mobile Device Management” could not be installed.
    
    Domain : MCProfileErrorDomain
    
    Code   : 1009
    
    Type   : MCFatalError
    
    Params : (
    
        "myCompanyName"
    
    )
    
  • 然后,我在“”上上载了一个plist编码的文件,并从那里下载了生成的推送证书

  • 安装下载到密钥链并以p12格式导出的pushcert,并将其命名为mdm.p12

  • 将mdm.p12转换为PEM格式:openssl pkcs12-in-mdm.12-out-pushcert.PEM-nodes

  • iPhone配置实用程序:

    我实施了iPCU的三个部分。对于服务器设置,我使用RapidSSL进行服务器设置

  • 一般的

    a。名称:我的私人有限公司

    b。标识符:com.mycompany.mdm.profile

    c。组织机构:我的公司名称

    d。说明:版本1.0

    e。安全:永远

  • 证书

    上载了在推送证书工作的最后一步生成的pushcert.pem文件

  • 移动设备管理

    a。服务器URL:

    b签入URL:

    c。主题:com.apple.mgmt.External.xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx

    d。标识:从凭证中选择

  • 导出iPCU->None/SignConfigurationProfile(两个都尝试过)

    现在,当我通过邮件发送此文件时,无法在设备上安装此文件,并且我收到的消息配置文件安装失败。我从日志中了解到,设备无法连接到服务器。请建议我如何解决此问题

    设备日志:

    Nov 27 19:02:21 iPhone profiled[114] <Notice>: (Note ) MC: Checking for MDM installation...
    
    Nov 27 19:02:21 iPhone profiled[114] <Notice>: (Note ) MC: ...finished checking for MDM installation.
    
    Nov 27 19:02:21 iPhone profiled[114] <Notice>: (Note ) MC: Beginning profile installation...
    
    Nov 27 19:02:21 iPhone profiled[114] <Error>:  SecTrustEvaluate  [leaf AnchorTrusted]
    
    Nov 27 19:02:23 iPhone locationd[63] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
    
    Nov 27 19:02:24 iPhone locationd[63] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
    
    Nov 27 19:02:24 iPhone profiled[114] <Error>:  SecTrustEvaluate  [leaf AnchorTrusted]
    
    Nov 27 19:02:26 iPhone profiled[114] <Notice>: (Error) MDM: Cannot Authenticate. Error: NSError:
    
    Desc   : A connection to the server could not be established.
    
    US Desc: A connection to the server could not be established.
    
    Domain : MCHTTPTransactionErrorDomain
    
    Code   : 23001
    
    Type   : MCFatalError
    
    Params : (
    
        "https://mdm.myCompanyName.com/Service1.svc",
    
        500
    
    )
    
    Nov 27 19:02:26 iPhone profiled[114] <Notice>: (Error) MC: Cannot install MDM “Mobile Device Management”. Error: NSError:
    
    Desc   : The payload “Mobile Device Management” could not be installed.
    
    Sugg   : A connection to the server could not be established.
    
    US Desc: The payload “Mobile Device Management” could not be installed.
    
    US Sugg: A connection to the server could not be established.
    
    Domain : MCInstallationErrorDomain
    
    Code   : 4001
    
    Type   : MCFatalError
    
    Params : (
    
        "Mobile Device Management"
    
    )
    
    ...Underlying error:
    
    NSError:
    
    Desc   : A connection to the server could not be established.
    
    US Desc: A connection to the server could not be established.
    
    Domain : MCHTTPTransactionErrorDomain
    
    Code   : 23001
    
    Type   : MCFatalError
    
    Params : (
    
        "https://mdm.myCompanyName.com/Service1.svc",
    
        500
    
    )
    
    Nov 27 19:02:26 iPhone profiled[114] <Notice>: (Error) MC: Rolling back installation of profile “com.myCompanyName.mdm.profile”...
    
    Nov 27 19:02:26 iPhone profiled[114] <Notice>: (Error) MC: Installation of profile “com.myCompanyName.mdm.profile” failed with error: NSError:
    
    Desc   : The profile “myCompanyName” could not be installed.
    
    Sugg   : The payload “Mobile Device Management” could not be installed.
    
    US Desc: The profile “myCompanyName” could not be installed.
    
    US Sugg: The payload “Mobile Device Management” could not be installed.
    
    Domain : MCProfileErrorDomain
    
    Code   : 1009
    
    Type   : MCFatalError
    
    Params : (
    
        "myCompanyName"
    
    )
    
    11月27日19:02:21 iPhone配置文件[114]:(注意)MC:正在检查MDM安装。。。
    11月27日19:02:21 iPhone配置文件[114]:(注意)MC:…已完成MDM安装检查。
    11月27日19:02:21 iPhone配置文件[114]:(注意)MC:开始配置文件安装。。。
    11月27日19:02:21 iPhone配置文件[114]:SecTrustEvaluate[叶子固定]
    11月27日19:02:23 iPhone位置D[63]:支持手势的端口客户端:0,支持守护程序设置:0
    11月27日19:02:24 iPhone位置D[63]:支持手势的客户端:0,支持守护程序设置:0
    11月27日19:02:24 iPhone配置文件[114]:SecTrustEvaluate[叶子固定]
    11月27日19:02:26 iPhone配置文件[114]:(错误)MDM:无法验证。错误:n错误:
    Desc:无法建立到服务器的连接。
    US Desc:无法建立与服务器的连接。
    域:MCHTTPTransactionErrorDomain
    代码:23001
    类型:MCFatalError
    参数:(
    "https://mdm.myCompanyName.com/Service1.svc",
    500
    )
    11月27日19:02:26 iPhone配置文件[114]:(错误)MC:无法安装MDM“移动设备管理”。错误:n错误:
    Desc:无法安装有效负载“移动设备管理”。
    Sugg:无法建立到服务器的连接。
    US Desc:无法安装有效负载“移动设备管理”。
    US Sugg:无法建立到服务器的连接。
    域:MCInstallationErrorDomain
    代码:4001
    类型:MCFatalError
    参数:(
    “移动设备管理”
    )
    …基本错误:
    N错误:
    Desc:无法建立到服务器的连接。
    US Desc:无法建立与服务器的连接。
    域:MCHTTPTransactionErrorDomain
    代码:23001
    类型:MCFatalError
    参数:(
    "https://mdm.myCompanyName.com/Service1.svc",
    500
    )
    11月27日19:02:26 iPhone配置文件[114]:(错误)MC:回滚配置文件“com.myCompanyName.mdm.profile”的安装。。。
    11月27日19:02:26 iPhone配置文件[114]:(错误)MC:配置文件“com.myCompanyName.mdm.profile”的安装失败,错误为:N错误:
    描述:无法安装配置文件“myCompanyName”。
    Sugg:无法安装有效负载“移动设备管理”。
    US Desc:无法安装配置文件“myCompanyName”。
    US Sugg:无法安装有效负载“移动设备管理”。
    域:MCProfileErrorDomain
    代码