最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

iOS9與XCode7中不能使用http連接的快速解決辦法

 更新時(shí)間:2016年10月24日 11:14:03   投稿:mrr  
這篇文章主要介紹了iOS9與XCode7中不能使用http連接的快速解決辦法,非常不錯(cuò)具有參考借鑒價(jià)值,感興趣的朋友一起看看吧,需要的朋友可以參考下

在Xcode7.0及以上版本中編譯iOS APP時(shí),默認(rèn)會(huì)使用iOS9的一項(xiàng)新特性,使得所有http連接被禁用,項(xiàng)目里使用的API沒有https支持,就悲劇了。差了官方文檔,有這么一段話

App Transport Security
App Transport Security (ATS) enforces best practices in the secure connections between an app and its back end. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt; it is also on by default in iOS 9 and OS X v10.11. You should adopt ATS as soon as possible, regardless of whether you're creating a new app or updating an existing one.
If you're developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible. In addition, your communication through higher-level APIs needs to be encrypted using TLS version 1.2 with forward secrecy. If you try to make a connection that doesn't follow this requirement, an error is thrown. If your app needs to make a request to an insecure domain, you have to specify this domain in your app's Info.plist file.

在這里面可以看到,通過修改Info.plist文件可以繼續(xù)使用http連接,具體的方法如下:

1.在項(xiàng)目左側(cè)找到Info.plist文件,可以通過Filter來搜索


2.在右側(cè)點(diǎn)擊Add Row添加NSAppTransportSecurity,類型為Dictionary,然后再添加子項(xiàng)目NSAllowsArbitraryLoads類行為Boolean值為YES


這樣就可以重新使用普通的http連接了。不過有條件的話,還是去搞一個(gè)https吧.

以上所述是小編給大家介紹的iOS9與XCode7中不能使用http連接的快速解決辦法,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

聂拉木县| 张家口市| 新巴尔虎左旗| 天峨县| 呼图壁县| 漾濞| 石城县| 华宁县| 萨嘎县| 乌审旗| 沿河| 天祝| 楚雄市| 徐闻县| 嘉鱼县| 汝阳县| 山西省| 烟台市| 东港市| 安多县| 泰安市| 奈曼旗| 揭西县| 莲花县| 喜德县| 万全县| 漳浦县| 龙井市| 中卫市| 那坡县| 昌都县| 耿马| 潜山县| 新化县| 和硕县| 和顺县| 盐亭县| 赫章县| 大港区| 崇礼县| 成安县|