首先新建一個(gè)mobileconfig文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<dict>
<key>URL</key>
<string>https://.test.security.com/security.php</string>
<key>DeviceAttributes</key>
<array>
<string>UDID</string>
<string>IMEI</string>
<string>ICCID</string>
<string>VERSION</string>
<string>PRODUCT</string>
</array>
</dict>
<key>PayloadOrganization</key>
<string>BBC, Inc.</string>
<key>PayloadDisplayName</key>
<string>獲取udid</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadUUID</key>
<string>9CF421B3-9853-4458-BC8A-982CBD3C912C</string>
<key>PayloadIdentifier</key>
<string>com.gpon.profile-service</string>
<key>PayloadDescription</key>
<string>This temporary profile will be used to find and display your current device's setting.</string>
<key>PayloadType</key>
<string>Profile Service</string>
</dict>
</plist>
然后服務(wù)端提供三個(gè)文件 ca.crt server.crt server.key
簽名加密 就ok了
openssl smime -sign -in testsecurity.mobileconfig -out testsecurity1.mobileconfig -signer server.crt -inkey server.key -certfile ca.pem -outform der -nodetach
錯(cuò)誤提示:ios12 http會報(bào)錯(cuò) url換成https顯示"發(fā)生 SSL 錯(cuò)誤,無法建立到該服務(wù)器的安全連接" 解決方法:https 服務(wù)器配置的證書不對 蘋果要求的是TLS1.2的
參考
http://www.rootmanager.com/iphone-ota-configuration/iphone-ota-setup-with-signed-mobileconfig.html