ios - Swift - 此服务器的证书无效

标签 ios swift server request invalidation

如何在 iOS 上使用 Swift 解决这个问题?当我发出服务器请求时,出现以下错误:

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

最佳答案

您只需在 iOS 模拟器上安装证书


来自 Charles Documentation :

Quit your iOS Simulator. Launch Charles and go to the Help menu. Choose the "SSL Proxying > Install Charles Root Certificate in iOS Simulators" item. This will install your Charles Root Certificate into all of your iOS Simulators. Now when you start the iOS Simulator, you should be able to access SSL websites with Charles using SSL Proxyin

关于ios - Swift - 此服务器的证书无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56108914/

相关文章:

java - Http 请求和响应没有返回任何内容

ios - Objective-C 中的调用方法层次结构

iphone - 应用程序在后台运行时可以调用webRequest吗?

ios - 检查编译时是否添加了框架 - iOS

ios - 如何正确设置同时具有框架目标和使用该框架的应用程序目标的 Podfile

php - wamp/ Composer /laravel5 : localhost:8000 just stopped working for no reason

ios - UIScrollView setContentOffset 会给scrollview 添加 subview ?

ios - 将相同的变量传递给具有不同值的容器 View

arrays - 删除按钮不起作用,collectionView

javascript - 将 JSON 属性转换为 int php