今天升級了iOS7.1後發現通過之前的url無法安裝公司專屬應用程式了,一直提示“無法安裝應用程式 因為http://xxx.xxx.xxx認證無效”,折騰了一番,終於在StackOverFlow上找到了答案。在這裡分享給大家。
StackOverFlow連結:http://stackoverflow.com/questions/20276907/enterprise-app-deployment-doesnt-work-on-ios-7-1/22325916#22325916
原因是由於iOS7.1要安裝公司專屬應用程式,url必須是https的,不能是http,這就要求我們的伺服器要支援https。因此,只要將原連結:
itms-services://?action=download-manifest&url=http://example.com/manifest.plist
改為
itms-services://?action=download-manifest&url=https://example.com/manifest.plist
即可。
對於伺服器,則需要增加對https的支援,本人用的是apache伺服器,所以在這裡以apache伺服器為例:
1. 安裝配有SSL模組的apache版本,本人使用的是httpd-2.0.65-win32-x86-openssl-0.9.8y
2. 開啟apache的設定檔conf/httpd.conf,去掉以下內容前的#
LoadModule ssl_module modules/mod_ssl.so
並在檔案最後加上:
<VirtualHost *:8080> ServerAdmin zhaoxinyan12@mails.tsinghua.edu.cn(隨意) DocumentRoot D:/Server(伺服器根目錄) ServerName 166.111.81.xxx(伺服器網域名稱或ip地址) ErrorLog logs/test-error_log CustomLog logs/test-access_log common SSLEngine on SSLCertificateFile "D:/Program Files/Apache Group/Apache2/conf/ssl.crt/server.crt"(之後產生認證的完整路徑) SSLCertificateKeyFile "D:/Program Files/Apache Group/Apache2/conf/ssl.key/server.key" (之後產生密鑰的完整路徑)</VirtualHost>
3. 修改conf/ssl.conf檔案的以下內容:(以下為修改完的,大家可以參考下)
#SSLSessionCache none#SSLSessionCache shmht:logs/ssl_scache(512000)SSLSessionCache shmcb:logs/ssl_scache(512000)#SSLSessionCache dbm:logs/ssl_scache...SSLCertificateFile conf/ssl.crt/server.crt...SSLCertificateKeyFile conf/ssl.key/server.key
4. 在conf目錄下建立ssl.crt和ssl.key目錄(不建立也行,只要保證以上兩個路徑和之後的檔案路徑對應即可)
5. 在命令列下切換到apache目錄下的bin目錄,運行以下命令
產生伺服器的私密金鑰:
openssl genrsa -out server.key 1024
6. 產生簽署申請(注意除Common Name以外可以為空白,Common Name必須為伺服器的ip或網域名稱):
openssl req -new –out server.csr -key server.key -config ..\conf\openssl.cnf
7. 產生CA私密金鑰:
openssl genrsa -out ca.key 1024
8. 利用CA的私密金鑰產生CA的自簽署認證(注意除Common Name以外可以為空白,Common Name必須為伺服器的ip或網域名稱):
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
9. 在目前的目錄建立demoCA,裡面建立檔案index.txt和serial,serial內容為01,index.txt為空白,以及檔案夾newcerts。
10. CA為網站伺服器簽署認證:
openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf
11. 最後將server.crt,server.key複製到上文對應的路徑下:
conf/ssl.crt/server.crtconf/ssl.key/server.key
12. 重啟Apache伺服器,即增加了https的支援。可以在瀏覽器訪問https://localhost試試。如果不行,可以在logs\test-error_log檔案中看看出了什麼錯誤。
13. 最後,我們要將自己建立的CA認證安裝到iphone上。將第10步產生的ca.crt檔案通過郵件發送到iphone上,用內建的Mail程式(別的程式不行)開啟安裝即可。
14. 現在,再次訪問我們之前的itms-services連結,就可以正常安裝了。
如果大家覺得對自己有協助的話,還希望能幫頂一下,謝謝:)個人部落格:http://blog.csdn.net/zhaoxy2850本文地址:http://blog.csdn.net/zhaoxy_thu/article/details/21133399轉載請註明出處,謝謝!