问题描述
Apple 似乎已取消信任 iOS 10 中自签名 SSL 证书的功能.
It appears that Apple has removed the ability to trust SSL certificates that are self-signed in iOS 10.
我创建了自己的自签名证书,并拥有一个使用我的证书签名的本地 Web 服务器.我必须在 iOS 中安装我的证书以进行本地测试,因为我开发了一个需要信任我的证书的 iOS 应用程序.
I created my own self-signed certificate and have a local web server that signed with my certificate. I must install my certificate in iOS for testing locally as I have developed an iOS application that needs to trust my certificate.
如何安装我的自签名证书?
How can I install my self-signed certificate?
推荐答案
好消息,他们没有.如果您只是出于开发目的需要它,听起来像您这样做(而且您不应该在生产中使用自签名证书),您可以在 iOS 设备上手动安装自签名证书.按照我的 iOS Web 蓝牙浏览器应用程序的等效 常见问题解答:
Good news, they haven't. If you just need this for development purposes, which it sounds like you do (and you shouldn't be using self-signed certificates in production anyway), you can install the self-signed certificate on your iOS devices manually. Following the equivalent FAQ for my iOS Web Bluetooth browser app:
- 使用 openssl 或其他方式创建您的自签名证书和密钥文件.确保它具有您本地服务器的正确
/CN Common Name"
,例如mycomputer.local
. - 配置您的网络服务器以使用它(显然)并检查它是否使用不同的客户端(例如 Mac 上的浏览器)工作.
- 将您的证书通过电子邮件发送到您可以在 iOS 设备上访问的电子邮件地址.
- 在您的 iOS 设备上点击 Mail 中的附件,现在应该会提示您安装它.这样做.
- 您现在应该通过转到 Settings 应用程序,然后转到
General -> 来验证它是否已安装.个人资料 -><通用名>
.在您安装第一个证书之前,配置文件菜单可能根本不存在.证书应标记为已验证(安装时已由您验证). - 您可能和我一样认为这已经足够了.不是.您现在,真的违反直觉,需要转到设置 General -> About -> Certificate Trust Settings 并在那里为您的证书启用完全信任.这种环境真是太奇怪了.
- Create your self-signed certificate and key files using openssl or however. Be sure it has the correct
/CN "Common Name"
for your local server, e.g.mycomputer.local
. - Configure your webserver to use it (obviously) and check that it is working using a different client, such as a browser on a Mac.
- Email your certificate to an email address you can access on your iOS device.
- Tap on the attachment in Mail on your iOS device, this should now prompt you to install it. Do so.
- You should now verify that it is installed by going to the Settings app then
General -> Profile -> <Common Name>
. The Profile menu probably won’t be there at all until you’ve installed the first certificate. The certificate should be marked Verified (it was verified by you when you installed it). - You might, like I did, have thought this would be enough. It isn’t. You now, really counter-intuitively, need to go to the setting General -> About -> Certificate Trust Settings and enable full trust for your certificate there as well. It’s such a weird place for that setting to be.
这篇关于如何在 iOS 10 中安装自签名证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!