美文网首页iOS Developer
一次iOS客户端升级到HTTPS的总结

一次iOS客户端升级到HTTPS的总结

作者: 窗外山海帆 | 来源:发表于2016-12-18 14:41 被阅读131次

一.对HTTPS,HTTP的了解。

聊聊 iOS 中的网络加密
http://www.jianshu.com/p/75d96b72bfb1
HTTPS 简要原理,iOS 上对证书链的验证
http://www.cnblogs.com/oc-bowen/p/5896041.html
iOS开发 支持https请求以及https请求的抓包 (比较全)
http://www.jianshu.com/p/97745be81d64

二.寻找SSL/TSL证书,CA的对比。

  1. 对比了两家机构,沃通,证书貌似不是很好!
  2. 朋友推荐的Geo trust!

三.客户端集成调试。
在开始客户端集成前,可以看看以下的两篇博客,做了比较详细的介绍:
iOS 升级HTTPS通过ATS你所要知道的
http://www.cocoachina.com/ios/20161207/18308.html
关于iOS9中的App Transport Security相关说明及适配(更新于2016.7.1)
https://my.oschina.net/vimfung/blog/494687?_t_t_t=0.1896578531749944

四.服务器端的配合调试。
服务器配置好,发送证书过来;

Paste_Image.png

五.其他问题。
调试遇到的坑:
1.服务器开启了双向认证?
2.关闭ATS请求后。
http://blog.csdn.net/zhouleizhao/article/details/51727720
配置Info.plist:[TLSV1.0,1.1,1.2]

<key>NSAppTransportSecurity</key>
     <dict>
          <key>NSExceptionDomains</key>
          <dict>
               <key>example.com.cn</key>
               <dict>
                    <key>NSExceptionRequiresForwardSecrecy</key>
                    <false/>
                    <key>NSIncludesSubdomains</key>
                    <true/>
                    <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                    <true/>
                    <key>NSTemporaryExceptionMinimumTLSVersion</key>
                    <string>TLSv1.0</string>
               </dict>
               <key>example1.cn</key>
               <dict>
                    <key>NSExceptionRequiresForwardSecrecy</key>
                    <false/>
                    <key>NSIncludesSubdomains</key>
                    <true/>
                    <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                    <true/>
                    <key>NSTemporaryExceptionMinimumTLSVersion</key>
                    <string>TLSv1.0</string>
               </dict>
          </dict>
     </dict>

3.调试Https,bug
http://stackoverflow.com/questions/30739473/nsurlsession-nsurlconnection-http-load-failed-on-ios-9/30748166#30748166

4.APPLe官方解读:
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW44

相关文章

网友评论

    本文标题:一次iOS客户端升级到HTTPS的总结

    本文链接:https://www.haomeiwen.com/subject/wizamttx.html