配置证书
1 申请SSL证书
先去网站上下载证书,如下图所示


如果服务端给的是crt后缀的证书,因为iOS客户端用到的cer证书,所以需要自行转换;
.crt转.cer证书方法:
同样方法将.crt证书下载到桌面上,打开终端,cd到.crt证书的路劲下,
执行命令
openssl x509 -in 你的证书.crt -out 你的证书.cer -outform der
就会在桌面上看到一个.cer的证书。双击导入电脑,然后在钥匙串中找到证书,并设置信任。
直接把转换好的cer文件拖动到工程中
2 设置AFN请求管理者的时候 添加 https ssl 验证。

或者

网友评论