Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
468 views
in Technique[技术] by (71.8m points)

ios - 传输安全性已阻止明文HTTP(Transport security has blocked a cleartext HTTP)

What setting do I need to put in my info.plist to enable HTTP mode as per the following error message?

(根据以下错误消息,我需要在info.plist添加什么设置才能启用HTTP模式?)

Transport security has blocked a cleartext HTTP (http://) resource load since it is insecure.

(传输安全性由于不安全,阻止了明文HTTP(http://)资源加载。)

Temporary exceptions can be configured via your app's Info.plist file.

(可以通过应用程序的Info.plist文件配置临时异常。)

Xcode

Assume that my domain is example.com .

(假设我的域名是example.com 。)

  ask by Jeef translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use NSAppTransportSecurity:

(使用NSAppTransportSecurity:)

在此处输入图片说明

You have to set the NSAllowsArbitraryLoads key to YES under NSAppTransportSecurity dictionary in your info.plist file.

(您必须将info.plist文件中NSAppTransportSecurity词典下的NSAllowsArbitraryLoads键设置为YES 。)

Plist配置


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...