生活随笔
收集整理的這篇文章主要介紹了
iOS7 企业应用无法安装应用程序 因为证书无效的解决方案
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
今天升級了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。因此,只要將原鏈接:
[plain] view plaincopy
itms-services://?action=download-manifest&url=http://example.com/manifest.plist??
改為
[plain] view plaincopy
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,去掉以下內容前的#
[plain] view plaincopy
LoadModule?ssl_module?modules/mod_ssl.so??
并在文件最后加上:
[plain] view plaincopy
<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文件的以下內容:(以下為修改完的,大家可以參考下)
[plain] view plaincopy
#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目錄,運行以下命令
生成服務器的私鑰:
[plain] view plaincopy
openssl?genrsa?-out?server.key?1024??
6. 生成簽署申請(注意除Common Name以外可以為空,Common Name必須為服務器的ip或域名):
[plain] view plaincopy
openssl?req?-new?–out?server.csr?-key?server.key?-config?..\conf\openssl.cnf??
7.?生成CA私鑰:
[plain] view plaincopy
openssl?genrsa??-out?ca.key?1024??
8.?利用CA的私鑰產生CA的自簽署證書(注意除Common Name以外可以為空,Common Name必須為服務器的ip或域名):
[plain] view plaincopy
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為網站服務器簽署證書:
[plain] view plaincopy
openssl?ca?-in?server.csr?-out?server.crt?-cert?ca.crt?-keyfile?ca.key?-config?..\conf\openssl.cnf??
11. 最后將server.crt,server.key復制到上文對應的路徑下:
[plain] view plaincopy
conf/ssl.crt/server.crt??conf/ssl.key/server.key??
12. 重啟Apache服務器,即增加了https的支持。可以在瀏覽器訪問https://localhost試試。如果不行,可以在logs\test-error_log文件中看看出了什么錯誤。
13. 最后,我們要將自己創建的CA證書安裝到iphone上。將第10步生成的ca.crt文件通過郵件發送到iphone上,用自帶的Mail程序(別的程序不行)打開安裝即可。
14. 現在,再次訪問我們之前的itms-services鏈接,就可以正常安裝了。
這種方法如果大家覺得麻煩的話可以把plist和ipa傳到dropbox上,獲取靜態鏈接,因為dropbox的服務器支持https且有第三方發布的證書,唯一的缺點是國內可能會慢一些。
如果大家覺得對自己有幫助的話,還希望能幫頂一下,謝謝:)
個人博客:http://blog.csdn.net/zhaoxy2850 本文地址:http://blog.csdn.net/zhaoxy_thu/article/details/21133399 轉載請注明出處,謝謝!
總結
以上是生活随笔為你收集整理的iOS7 企业应用无法安装应用程序 因为证书无效的解决方案的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。