ios - 是否可以创建自签名 ssl 证书来避免应用程序代码中的 "challenge"?

标签 ios django ssl-certificate ios-simulator

背景

我有一个第三方框架,它对我提供给它的 URL 进行一些网络请求。 请求的格式为: https://10.0.2.2:8000/api/ ....

由于架构是 https,我不断收到来自第三方库的错误消息:

The certificate for this server is invalid. You might be connecting to a server that is pretending to be “10.0.2.2” which could put your confidential information at risk.

服务器是一个以

启动的 Django 应用程序
python3 manage.py runserver_plus 10.0.2.2:8000 --cert-file _my_cert.crt

我尝试了很多方法来生成自签名证书并将其安装到模拟器并运行服务器,但是,它们都无法帮助避免第三方库中的错误。

问题

所以我想知道这是否有意义。

是否可以生成自签名证书并将其安装到 iOS 模拟器中,这将避免解决此处描述的挑战: https://developer.apple.com/documentation/foundation/url_loading_system/handling_an_authentication_challenge/performing_manual_server_trust_authentication?language=objc

请提供任何类型答案的证据,无论是还是

最佳答案

您可以从https://letsencrypt.org获取免费的SSL证书

尝试一次就可以了。

关于ios - 是否可以创建自签名 ssl 证书来避免应用程序代码中的 "challenge"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59953321/

相关文章:

ios - Swift:如何从String中提取日期作为NSDate?

python - django-open-id : CSRF verification failed

oracle - 确定使用 Oracle utl_http 执行 https post 需要哪个证书

ruby - ruby docker 图像中的过期 ca 证书(2.6.8-bullseye)

android - 将文件保存在 iOS 应用程序目录中

ios - 如何在 Xamarin iOS 上获取 Google map 的许可文本?

python - 如何在Django中获取一个url对应的 View (使用url)?

ios - 为什么我的 iOS 配置文件是 "Not Trusted"?

ios - 当搜索栏文本为空时,UISearchController searchResultsController 消失

mysql - 仅显示 django 模型管理中其他模型中的唯一记录