将自签名证书添加到iphone Simulator? [英] Adding a self-signed certificate to 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模拟器从哪里获得钥匙串?如何添加可信证书以便我的申请可以使用?
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屋!