IOS- 企业App"无法升级安装应用程序 因为证书无效"的解决方案

今天调试自己开发的一款企业级App,发现通过之前的url无法升级安装企业应用,一直提示“无法安装应用程序 因为http://xxx.xxx.xxx证书无效”,折腾了一番,终于在StackOverFlow上找到了答案。在这里分享给大家。

StackOverFlow接:http://stackoverflow.com/questions/20276907/enterprise-app-deployment-doesnt-work-on-ios-7-1/22325916#22325916
原因是由于要安装更新企业应用,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!
GitHub下载链接:https://gist.github.com/dergachev/7028596

# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
#    openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
#    python simple-https-server.py
# then in your browser, visit:
#    https://localhost:4443

import BaseHTTPServer, SimpleHTTPServer
import ssl

httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./server.pem', server_side=True)
httpd.serve_forever()

其中httpd = BaseHTTPServer.HTTPServer((‘localhost’, 4443),
把’localhost’改成’ ‘,否则不能在手机的浏览器访问。
httpd = BaseHTTPServer.HTTPServer((’ ‘, 4443);

在电脑上启动:
python -m SimpleHTTPServer

访问
https://192.168.xx.xx:4443

itms-services://?action=download-manifest&url=http://192.168.xx.xx:4443/manifest.plist  

可以把plist上传到自己本机,然后可以用手机测试企业级app更新升级了。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值