App Transport Security policy requires the use of a secure connection

99封情书 提交于 2019-12-02 14:28:05

问题


I added the NsAppTransportSecurity as dictionary and added the key NsAllowArbitaryLoads exactly how everybody said but it does not work for me. I made a clean rebuild of the project, but I still the same error.


回答1:


It should be done like this

NSAppTransportSecurity <- Type Dictionary NSAllowsArbitraryLoads <- Type Boolean Value YES




回答2:


It should be done like:

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>your.domain.name.net</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
                <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>


来源:https://stackoverflow.com/questions/32703226/app-transport-security-policy-requires-the-use-of-a-secure-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!