明文 HTTP 被阻止
Cleartext HTTP blocked
更新到新发布的 Xcode 7 版本后,我遇到了这个问题。
App Transport Security 已阻止明文 HTTP (http://) 资源加载,因为它不安全。可以通过您应用的 Info.plist 文件配置临时例外。
gete 无法加载资源,因为应用程序传输安全策略要求使用安全连接。
我做了一些搜索,找到了解决方案,说要将这些行添加到我项目中的 info.plist 文件中,但问题没有解决
<?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>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.thenewsapp.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>greenarea.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
</dict>
</plist>
任何帮助
提到here
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.
明确提到您将从 http
开始使用 https
协议,直到那时这是解决方法
此外,除了 plist 中的 NSAllowsArbitraryLoads 之外,从 NSAppTransportSecurity dict
中删除所有剩余的密钥
更新到新发布的 Xcode 7 版本后,我遇到了这个问题。
App Transport Security 已阻止明文 HTTP (http://) 资源加载,因为它不安全。可以通过您应用的 Info.plist 文件配置临时例外。 gete 无法加载资源,因为应用程序传输安全策略要求使用安全连接。
我做了一些搜索,找到了解决方案,说要将这些行添加到我项目中的 info.plist 文件中,但问题没有解决
<?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>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.thenewsapp.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>greenarea.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
</dict>
</plist>
任何帮助
提到here
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.
明确提到您将从 http
开始使用 https
协议,直到那时这是解决方法
此外,除了 plist 中的 NSAllowsArbitraryLoads 之外,从 NSAppTransportSecurity dict
中删除所有剩余的密钥