简体   繁体   English

在 iPhone 模拟器上成功安装证书后,点击我的网络服务时仍然出现 SSL 错误

[英]After successfully installing a cert on iPhone simulator, I still get an SSL error when hitting my web service

I am developing a web service and iOS app that hits the web service on my local machine.我正在开发一个 Web 服务和 iOS 应用程序,它可以在我的本地机器上访问 Web 服务。 At first, I disabled the cleartext errors for interacting with the service, but now I would like to use https so that my development, test, and prod environments are as similar as possible.起初,我禁用了与服务交互的明文错误,但现在我想使用 https,以便我的开发、测试和生产环境尽可能相似。

I installed my self-signed cert locally, so going to the site directly is using https just fine:我在本地安装了我的自签名证书,所以直接访问该站点使用 https 就好了: 在此处输入图片说明

I have followed the instructions to install a cert in the iPhone simulator:我已按照说明在 iPhone 模拟器中安装证书: 在此处输入图片说明

However, when I hit the web service on my local machine that uses this cert, I still get these error in the console:但是,当我在使用此证书的本地计算机上访问 Web 服务时,我仍然在控制台中收到这些错误:

2020-10-17 09:59:10.891496-0500 cttios[45481:2146304] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
2020-10-17 09:59:10.899475-0500 cttios[45481:2146304] ATS failed system trust
2020-10-17 09:59:10.899583-0500 cttios[45481:2146304] Connection 1: system TLS Trust evaluation failed(-9802)
2020-10-17 09:59:10.899744-0500 cttios[45481:2146304] Connection 1: TLS Trust encountered error 3:-9802
2020-10-17 09:59:10.900077-0500 cttios[45481:2146304] Connection 1: encountered error(3:-9802)
2020-10-17 09:59:10.901405-0500 cttios[45481:2146304] Task <BE791070-705B-4C7D-A1DB-F57BCF1DFBCE>.<1> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9802])
2020-10-17 09:59:10.904343-0500 cttios[45481:2146304] Task <BE791070-705B-4C7D-A1DB-F57BCF1DFBCE>.<1> finished with error [-1200] Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=(
    "<cert(0x7ff4ce854600) s: cttweb.test i: Homestead homestead Root CA>"
), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://cttweb.test/api/v1/login, NSErrorFailingURLStringKey=https://cttweb.test/api/v1/login, NSUnderlyingError=0x600001123ab0 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x600002d55cb0>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates=(
    "<cert(0x7ff4ce854600) s: cttweb.test i: Homestead homestead Root CA>"
)}}, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <BE791070-705B-4C7D-A1DB-F57BCF1DFBCE>.<1>"
), _kCFStreamErrorCodeKey=-9802, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <BE791070-705B-4C7D-A1DB-F57BCF1DFBCE>.<1>, NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x600002d55cb0>, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made.}
Login api error: An SSL error has occurred and a secure connection to the server cannot be made.
Optional(["task": ["Login api error: An SSL error has occurred and a secure connection to the server cannot be made."]])

I have tried restarting the simulator after installing the cert, same result.我尝试在安装证书后重新启动模拟器,结果相同。 What am I doing wrong?我究竟做错了什么?

It looks like I may not be trusting the cert even after installing it, but I can't find a way to trust it.看起来即使在安装证书后我也可能不信任它,但我找不到信任它的方法。 在此处输入图片说明

The problem is that I had the website cert installed, but not the CA cert generated for my local web server installed.问题是我安装了网站证书,但没有安装为我的本地 Web 服务器生成的 CA 证书。 That was as easy as dragging the CA root cert into Safari on the simulator.这就像将 CA 根证书拖入模拟器上的 Safari 一样简单。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试通过 VS Studio 和 Xcode 在 iphone 模拟器上运行我的应用程序,当我运行模拟器时出现此错误: - Trying to run my app on an iphone simulator through VS Studio and Xcode and when I run the simulator I get this error: 为什么我的应用程序可以在模拟器中运行,但是在iPhone上运行时却卡在启动屏幕上? - Why does my app work in the simulator but get stuck on the splash screen when I run it on my iPhone? 当我尝试运行项目并且未使用模拟器时,为什么iPhone模拟器显示“正在使用模拟器”? - Why does the iPhone simulator show “Simulator in use” when I try to run my project and the simulator is not in use? 即使手动安装证书后也无法通过iOS模拟器上的SSL握手 - Cant get past SSL handShake on iOS simulator even after manual installing certificate 在iOS模拟器上成功构建Skia,但无法在我的iPhone上运行 - Building skia on ios simulator successfully,but cannot run on my iphone 从Xcode重新安装应用程序时,iPhone模拟器报告错误 - iPhone simulator reporting error when re-installing an app from Xcode 如何使用模拟器分享我的 iphone 应用程序仍然 ind 开发 - How to share my iphone app still ind development using simulator 我的iPhone应用程序不会在新的iPhone 5模拟器中使用信箱运行。 我怎么把它拿到信箱? - My iPhone App won't run with letterboxes in the new iPhone 5 simulator. How do I get it to letterbox? 有没有办法在iPhone模拟器上按菜单按钮然后重新启动应用程序后看到记录? - is there a way to see logging after hitting Menu button on iPhone simulator then relaunching the app? 在iPhone上测试应用程序时出错,但模拟器中没有错误 - Error when testing application on iPhone, but no error in simulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM