iOS 中的开发和生产 SSL 证书有什么区别? [英] What is the difference between development and production SSL certificates in iOS?

查看:40
本文介绍了iOS 中的开发和生产 SSL 证书有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个奇怪的问题,但它确实让我感到困惑.为什么我们必须为 iOS 中的推送通知创建开发和生产 SSL 证书?开发证书和生产证书有什么区别?

This is maybe a strange question but it is really confusing me. Why do we have to create a development and a production SSL certificate for push notifications in iOS? What is the difference between the development and the production certificates?

我正在开发一个带有推送通知的 iOS 应用程序(由自托管的解析服务器处理),当我将环境从开发切换到生产(使用生产证书)时,我不再收到推送通知设备.一旦我将此应用程序上传到应用程序商店(然后,它将投入生产),它会起作用吗?或者我可以测试"我的生产环境以确保通知在我的应用程序发布到应用程序商店后可以在我的应用程序中正常工作?

I am developing an iOS app with Push notifications (handled by a self-hosted Parse Server) and when I switch my environment from development to production (with a production certificate), I don't receive the push notifications anymore on my devices. Will it work once I upload this app to the app store (then, it will be in production)? Or can I "test" my production environment to be sure the notifications will work in my app once published on the app store?

推荐答案

Apple 使用不同的服务器向应用的开发版本和应用商店版本发送推送通知.开发版本称为 Sandbox.iOS 与其推送服务器保持持久连接,具体取决于其开发版本还是生产版本.根据您的应用程序签署的证书(Dev 或 App Store/Ad Hoc),它将创建与相应推送服务器的持久连接.由于两台服务器不同,它们需要不同的 SSL 证书才能与服务器建立安全连接.

Apple uses different servers for sending push notifications to development versions and app store versions of the app. The development version is called Sandbox. The iOS maintains persistent connection to the its push servers depending on whether its development version or production version. Based on which certificate your app is signed (Dev or App Store/Ad Hoc) it will create a persistent connection to the respective push server. Since the two servers are different they will need different SSL certificates to establish a secure connection to the server.

更多信息请参考:

https://developer.apple.com/library/ios/technotes/tn2265/_index.html

这篇关于iOS 中的开发和生产 SSL 证书有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆