Coder Social home page Coder Social logo

wxyhttpsworking's Introduction

WxyHttpsWorking

基于AFN3.1.0的https SSL认证

近来关于苹果对https审核相关的信息在iOS开发者中讨论很多,恰巧由于工作原因之前已经进行过关于https的相关设置,所以便整理了一下。

首先web服务器必须提供一个ssl证书,需要一个 .crt 文件,然后设置app只能连接有效ssl证书的服务器。

在开始写代码前,先要把 .crt 文件转成 .cer 文件,然后在加到xcode 里面

.crt 文件转成 .cer 文件

  • 打开电脑终端,使用openssl进行转换: openssl x509 -in 你的证书.crt -out 你的证书.cer -outform der

  • 通过安装crt文件,电脑导出:

    1)先打开“钥匙串访问”

    2)选中你安装的crt文件证书,选择“文件”--》“导出项目”

    3)选择.cer证书,存储即可。

将转成的.cer文件拖入工程,将Demo中的“WxyNetWorking”文件夹拖入工程,在网络请求的类中引入头文件“WxyNetWorking.h” 就可以正常的网络请求了。相信你一定会网络请求。

注:由于cer证书是真实的项目在用,不便提供,因为没有找到合适的请求链接所以Demo中没有演示,敬请谅解。

相关阅读

ATS配置官方说明 (官方文档第一)

《HTTPS权威指南》- SSL、TLS和密码学学习笔记

《HTTPS权威指南》-协议学习笔记

《HTTPS权威指南》-公钥基础设施(PKI)学习笔记

苹果强制使用HTTPS传输后APP开发者必须知道的事

许可证

WxyHttpsWorking 使用 MIT 许可证,详情见 LICENSE 文件。

wxyhttpsworking's People

Contributors

wxinyi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.