向 iphone Simulator 添加自签名证书? [英] Adding a self-signed certificate to iphone Simulator?

查看:36
本文介绍了向 iphone Simulator 添加自签名证书?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 API 端点有一个自签名证书.我正在尝试使用模拟器测试一些东西,但我得到了不受信任的服务器证书".

I have a self-signed certificate at the endpoint of my API. I'm trying to test some things using the simulator but am getting "untrusted server certificate".

我尝试在模拟器上使用 safari 下载 .crt 文件,但这似乎不起作用.

I have tried to use safari on the simulator to download the .crt file, but that doesn't seem to work.

iPhone Simulator 从哪里获得钥匙串?如何添加受信任的证书以便我的应用程序正常运行?

Where does iPhone Simulator get its keychain from? How can I add a trusted certificate so my application will work?

更新

我通过创建 CA 然后使用 iPhone 配置工具添加 CA 证书来使其工作.然后我能够在 API 服务器上获得由该 CA 证书签名的证书,并且 NSConnection 刚刚工作.由于某种原因,我无法使用自签名证书使其正常工作.我需要使用配置软件重新尝试此操作.

I got it to work by creating a CA and then adding a CA certificate using the iPhone provisioning tool. Then I was able to have a certificate signed by that CA certificate on the API server and the NSConnection just worked. I was not able to get it to work using a self-signed certificate for some reason. I need to re-attempt this using the provisioning software.

我真正的问题是如何让它在模拟器上工作?我认为模拟器使用的是实际计算机的钥匙串.

My real question is how do I get this to work on the simulator? I would think that the simulator uses the keychain of the actual computer.

推荐答案

仅供参考,如果有人仍然遇到该问题:

Just for Info, if someone still runs into that problem:

只需拖动 &将您的 .cer 文件放入正在运行的模拟器窗口中.您将看到 Safari 闪烁,然后是您的证书(或证书颁发机构)的导入对话框...

simply drag & drop your .cer Files into your running Simulator window. You'll see Safari flashing and then the import dialog for your Certificate (or Certificate Authority)...

适用于 iOS 7 模拟器(我认为也适用于 iOS 6).

Working for iOS 7 Simulator (and i Think did work for iOS 6 too).

这篇关于向 iphone Simulator 添加自签名证书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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