• iOS7.1企业应用"无法安装应用程序 因为证书无效"的解决方案


    今天升级了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。因此,只要将原链接:

    1. itms-services://?action=download-manifest&url=http://example.com/manifest.plist  

    改为

    1. 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,去掉以下内容前的#

    1. LoadModule ssl_module modules/mod_ssl.so  

    并在文件最后加上:

    1. <VirtualHost *:8080>  
    2.     ServerAdmin zhaoxinyan12@mails.tsinghua.edu.cn(随意)  
    3.     DocumentRoot D:/Server(服务器根目录)  
    4.     ServerName 166.111.81.xxx(服务器域名或ip地址)  
    5.     ErrorLog logs/test-error_log  
    6.     CustomLog logs/test-access_log common  
    7.     SSLEngine on  
    8.     SSLCertificateFile "D:/Program Files/Apache Group/Apache2/conf/ssl.crt/server.crt"(之后生成证书的完整路径)  
    9.     SSLCertificateKeyFile "D:/Program Files/Apache Group/Apache2/conf/ssl.key/server.key" (之后生成密钥的完整路径)  
    10.   
    11. </VirtualHost>  


    3. 修改conf/ssl.conf文件的以下内容:(以下为修改完的,大家可以参考下)

    1. #SSLSessionCache        none  
    2. #SSLSessionCache        shmht:logs/ssl_scache(512000)  
    3. SSLSessionCache        shmcb:logs/ssl_scache(512000)  
    4. #SSLSessionCache         dbm:logs/ssl_scache  
    5. ...  
    6. SSLCertificateFile conf/ssl.crt/server.crt  
    7. ...  
    8. SSLCertificateKeyFile conf/ssl.key/server.key  

    4. 在conf目录下创建ssl.crt和ssl.key目录(不创建也行,只要保证以上两个路径和之后的文件路径对应即可)

    5. 在命令行下切换到apache目录下的bin目录,运行以下命令

    生成服务器的私钥:

    1. openssl genrsa -out server.key 1024  

    6. 生成签署申请(注意除Common Name以外可以为空,Common Name必须为服务器的ip或域名):

    1. openssl req -new –out server.csr -key server.key -config ..confopenssl.cnf  

    7. 生成CA私钥:

    1. openssl genrsa  -out ca.key 1024  

    8. 利用CA的私钥产生CA的自签署证书(注意除Common Name以外可以为空,Common Name必须为服务器的ip或域名):

    1. openssl req  -new -x509 -days 365 -key ca.key -out ca.crt  -config ..confopenssl.cnf  

    9. 在当前目录创建demoCA,里面创建文件index.txt和serial,serial内容为01,index.txt为空,以及文件夹newcerts。

    10. CA为网站服务器签署证书:

    1. openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..confopenssl.cnf  

    11. 最后将server.crt,server.key复制到上文对应的路径下:

    1. conf/ssl.crt/server.crt  
    2. conf/ssl.key/server.key  

    12. 重启Apache服务器,即增加了https的支持。可以在浏览器访问https://localhost试试。如果不行,可以在logs est-error_log文件中看看出了什么错误。

    13. 最后,我们要将自己创建的CA证书安装到iphone上。将第10步生成的ca.crt文件通过邮件发送到iphone上,用自带的Mail程序(别的程序不行)打开安装即可。

    14. 现在,再次访问我们之前的itms-services链接,就可以正常安装了。


    这种方法如果大家觉得麻烦的话可以把plist和ipa传到dropbox上,获取静态链接,因为dropbox的服务器支持https且有第三方发布的证书,唯一的缺点是国内可能会慢一些。

  • 相关阅读:
    WebStorm 在 Mac 版本的基本设置,包括 ES6、Node.js、字体大小等
    Mac 找文件或文件夹,以及开启其他程序,截图快捷键
    windows 全局安装 express 但无法命令行执行
    17_11_3 Mysql 联合查询
    17_11_1 Mysql 创建表并设置主键自增 + 排序 +外键
    PLC
    17_10_31 ./ ../ / ~/的区别
    17_10_30 Mac qq可以登录但是网页打不开
    17_10_26 面试汇总
    17_10_25 SSH 框架
  • 原文地址:https://www.cnblogs.com/lingzhao/p/3673321.html
Copyright © 2020-2023  润新知