ios - 我们如何在 Delphi iOS 中使用 Open SSL?

标签 ios security delphi ssl firemonkey

Apple 在使用 Open SSL 时对其应用程序传输安全性进行了一些更改,但我无法使其在 iOS 上运行。

“App Transport Security is a feature that improves the security of connections between an app and web services. The feature consists of default connection requirements that conform to best practices for secure connections. Apps can override this default behavior and turn off transport security. Transport security is available in iOS 9.0 or later, and in OS X v10.11 and later.”

尝试连接到我们的服务器时,出现以下响应错误:

"An SSL error has occurred and a secure connection to the server cannot be made."

然后,我找到了this tutorial并发现我们需要做的就是在项目的一个使用语句中包含单元 IdSSLOpenSSLHeaders_Static

我确实将单元以及 libcrypto.alibssl.a. 库添加到项目中,但到目前为止我得到了相同的响应错误。

我可能做错了什么?

最佳答案

要禁用ATS,您还需要按照this official embarcadero documentation 中的步骤进行操作:

打开您的 Info.plist 并添加以下行:

<key> NSAppTransportSecurity</key>
<dict>
     <key>NSAllowsArbitraryLoads</key>
     <true/>
</dict>

这将为应用程序使用的 所有 HTTP 通信禁用 Apple 的应用程序传输安全功能,例如,如果您使用 TWebBrowser 或 Project Indy 的 HTTP组件。

每次部署完成时,您项目的 Info.plist 文件都会重新生成。您需要将文件保存到不同的位置,例如您的项目目录。 (请注意,32 位和 64 位版本略有不同)。

在新保存的文件中进行更改,然后转到部署管理器(项目 -> 部署)。确保配置设置正确并取消选中默认的 Info.plist

添加新的自定义版本并确保将远程名称设置为“Info.plist”(区分大小写)。对 64 位和 32 位部署执行此操作。

关于ios - 我们如何在 Delphi iOS 中使用 Open SSL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35348528/

相关文章:

security - 登录后将用户重定向到登录表单中提供的 URL 会带来哪些安全问题?

java - 如何从 hashCode 获取字符串

mysql - 如何最好地在 MySql 中存储日期/时间?

Delphi 错误列表框

delphi - 知道IP是否属于delphi中的特定子网和网络掩码

ios - Cocoapods - 无法找到 [Github 框架] 的规范

ios - Google+ SDK 解决 iOS 崩溃问题

具有大小类的 iOS8 自动布局在预览中有效,但在设备/模拟器中无效

ios - 如何处理 UIViewController 中的 UIApplicationDelegate 方法?

linux - Linux 上的 Apache2 权限