如何在 iOS 10 中安装自签名证书

How to install self signed certificate in iOS 10(如何在 iOS 10 中安装自签名证书)
本文介绍了如何在 iOS 10 中安装自签名证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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:

  1. 使用 openssl 或其他方式创建您的自签名证书和密钥文件.确保它具有您本地服务器的正确 /CN Common Name",例如mycomputer.local.
  2. 配置您的网络服务器以使用它(显然)并检查它是否使用不同的客户端(例如 Mac 上的浏览​​器)工作.
  3. 将您的证书通过电子邮件发送到您可以在 iOS 设备上访问的电子邮件地址.
  4. 在您的 iOS 设备上点击 Mail 中的附件,现在应该会提示您安装它.这样做.
  5. 您现在应该通过转到 Settings 应用程序,然后转到 General -> 来验证它是否已安装.个人资料 -><通用名>.在您安装第一个证书之前,配置文件菜单可能根本不存在.证书应标记为已验证(安装时已由您验证).
  6. 您可能和我一样认为这已经足够了.不是.您现在,真的违反直觉,需要转到设置 General -> About -> Certificate Trust Settings 并在那里为您的证书启用完全信任.这种环境真是太奇怪了.
  1. 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.
  2. Configure your webserver to use it (obviously) and check that it is working using a different client, such as a browser on a Mac.
  3. Email your certificate to an email address you can access on your iOS device.
  4. Tap on the attachment in Mail on your iOS device, this should now prompt you to install it. Do so.
  5. 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).
  6. 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 中安装自签名证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)