简体   繁体   English

如何在iOS中实现SSL固定?

[英]How to implement SSL Pinning in iOS?

I am little bit confuse to implement SSL pinning in my iOS app. 我有点困惑在我的iOS应用程序中实现SSL固定。 I read many articles some are saying implement with Certificate and some are saying implement with public key. 我读了许多文章,有些在说使用证书的工具,有些在说使用公钥的工具。

I have some doubts: 我有些疑惑:

  1. Which method is best for SSL pinning? 哪种方法最适合SSL固定?
  2. How to get Certificate and public key? 如何获得证书和公钥?

It helps me a lot if any one have example code. 如果有人有示例代码,这对我有很大帮助。

You could check out GCXTrustPolicy 您可以签出GCXTrustPolicy

It is a framework which was developed by some people of the company I am working at. 它是由我所在公司的一些人开发的框架。 It does certificate pinning and a little more. 它做证书固定和更多。

Have a look at the code to understand how pinning works. 查看代码以了解固定的工作原理。

Sorry for late, I found the solution TrustKit 对不起,我找到了TrustKit解决方案

TrustKit is an open source framework that makes it easy to deploy SSL public key pinning and reporting in any iOS 8+, macOS 10.10+, tvOS 10+ or watchOS 3+ App; TrustKit是一个开源框架,可轻松在任何iOS 8 +,macOS 10.10 +,tvOS 10+或watchOS 3+ App中部署SSL公钥固定和报告。 it supports both Swift and Objective-C Apps. 它同时支持Swift和Objective-C应用。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM