1、SSL证书
首先向后台开发者获取SSL证书(crt格式),使用钥匙串打开。


选中加入钥匙串中的证书,点击屏幕左上方的文件,点击导出项目,保存文件格式为.cer的文件到桌面。



好了 证书到这里就拿到了。
2、添加到工程中
将已经转化好格式的文件拖拽到工程中,并且添加到Copy Bundle Resources中。


3、配置AFN
创建类方法 +(AFSecurityPolicy*)customSecurityPolicy;


配置完成,重新运行就OK了,欢迎改正。
1、SSL证书
首先向后台开发者获取SSL证书(crt格式),使用钥匙串打开。
选中加入钥匙串中的证书,点击屏幕左上方的文件,点击导出项目,保存文件格式为.cer的文件到桌面。
好了 证书到这里就拿到了。
2、添加到工程中
将已经转化好格式的文件拖拽到工程中,并且添加到Copy Bundle Resources中。
3、配置AFN
创建类方法 +(AFSecurityPolicy*)customSecurityPolicy;
配置完成,重新运行就OK了,欢迎改正。
本文标题:iOS https 配置详解(简单就好)
本文链接:https://www.haomeiwen.com/subject/zyngettx.html
网友评论