简体   繁体   English

App Transport Security已阻止明文HTTP XCode 7.1

[英]App Transport Security has blocked a cleartext HTTP XCode 7.1

I have seen the App transport secuirty blocker in my code for XCode 7.1. 我在XCode 7.1的代码中看到了App Transport Secuirty阻止程序。 I have tried couple of options from stackoverflow to set NSAllowsArbitraryLoads to true but still this is not working, Any more suggestions would really help. 我已经尝试了stackoverflow中的几个选项来将NSAllowsArbitraryLoads设置为true,但是这仍然行不通,任何其他建议都会真正帮助您。

Logs 日志

2016-01-12 14:06:21.575 FoxNewsServic[54081:13484633] 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.
my info.plist looks like below. 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>KWatch WatchKit Extension</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>com.kone.com.watchkitextension</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>XPC!</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>NSExtension</key>
    <dict>
        <key>NSExtensionAttributes</key>
        <dict>
            <key>WKAppBundleIdentifier</key>
            <string>com.kone.com.watchkitapp</string>
        </dict>
        <key>NSExtensionPointIdentifier</key>
        <string>com.apple.watchkit</string>
    </dict>
    <key>RemoteInterfacePrincipalClass</key>
    <string>InterfaceController</string>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key><true/>
    </dict>
</dict>
</plist>

Use NSTemporaryExceptionAllowsInsecureHTTPLoads instead of NSAllowsArbitraryLoads 使用NSTemporaryExceptionAllowsInsecureHTTPLoads代替NSAllowsArbitraryLoads

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>myDomain.net</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
        <key>anotherDomain.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 App Transport Security已阻止明文HTTP Xcode7.1 - App Transport Security has blocked a cleartext HTTP Xcode7.1 XCode - Swift - App Transport Security已阻止明文HTTP(http://)错误 - XCode - Swift - App Transport Security has blocked a cleartext HTTP (http://) error App Transport Security已阻止明文HTTP资源 - App Transport Security has blocked a cleartext HTTP resource 传输安全已阻止明文 HTTP - Transport security has blocked a cleartext HTTP 由于 App Transport Security 阻止了应用程序访问,阻止了明文 HTTP 并完成了几乎所有操作 - App access blocked due to App Transport Security has blocked a cleartext HTTP and done almost everything iOS swift:App Transport Security阻止了一个明文HTTP(http://)资源 - iOS swift: App Transport Security has blocked a cleartext HTTP (http://) resource 由于应用传输安全性不安全,它阻止了明文HTTP(http://)资源加载 - App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure 无论我尝试什么,我都会收到“App Transport Security 已阻止明文 HTTP (http://) 资源加载,因为它不安全。” - No matter what I try, I get “App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.” Xcode 7.1的App Transport Security - App Transport Security with Xcode 7.1 使用 HTTPS api 调用时出现“传输安全已阻止明文 HTTP”错误 - Getting "Transport Security has blocked a cleartext HTTP" error while using HTTPS api calls
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM