1.修改你的服務器配置,使它支持HTTPS訪問
2.修改你的info.plist配置,讓APP能訪問普通的HTTP協議網站
否則調試程序時會在Log中出現以下提示:
App Transport Security has blocked a cleartext HTTP (http://) resource
load since it is insecure. Temporary exceptions can be configured via
your app's Info.plist file.
修改info.plist時,APPLE也提供了修改方法,在info.plist中增加以下內容即可
NSAppTransportSecurity
NSExceptionDomains
lidaren.com
NSIncludesSubdomains
NSTemporaryExceptionAllowsInsecureHTTPLoads
NSTemporaryExceptionMinimumTLSVersion
TLSv1.1
如果你的app具有瀏覽器功能,可以這樣改,就可以完全放開HTTP訪問功能了
NSAppTransportSecurity
NSAllowsArbitraryLoads
最後附上原文鏈接
https://stackoverflow.com/questions/30720813/cfnetwork-sslhandshake-failed-ios-9
--------------------------------------------------------------------------------------
- 版權聲明:
- 如在本頁面內無特別說明,本文內容均爲[李大仁博客]原創,本文版權歸[李大仁博客]所有。
- 歡迎轉載,轉載請務必在文章頁面明顯位置提供原文鏈接並註明出處。歡迎您在轉載本文時保留本段聲明。
- 文章標題:[iOS] iOS9.0 關閉系統強制使用HTTPS
- 獨立博客:李大仁博客
- 永久鏈接:http://www.lidaren.com/archives/1556
--------------------------------------------------------------------------------------
以上內容由博客自動發佈工具自動發佈,最終顯示內容和效果會與原文內容有所偏差,敬請諒解。