-4

Error : The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

How can I do? Please give me solution, Thanks.

Tharoth
  • 383
  • 5
  • 15

1 Answers1

2

From App Transport Security Technote

Default Behavior:
All connections using the NSURLConnection, CFURL, or NSURLSession APIs use App Transport Security default behavior in apps built for iOS 9.0 or later, and OS X 10.11 or later. Connections that do not follow the requirements will fail.

The solution is to up date the server to https TLS 1.2 and forward security. Also only supporting the encryption method in the above Security Technote.

Another solution is to whitelist the url on the app plist or even if necessary allow all http connections. This reduces the connection security, the best approach is to update the server.

Apple supplied information about this several places:

There was the WWDC 2015 session 706 that described as well as the release notes: What's New in iOS iOS 9.0. I believe it was also mentioned in the WWDC keynote.

Also see this SO Answer: About ATS SSL in iOS 9 release version.

Community
  • 1
  • 1
zaph
  • 111,848
  • 21
  • 189
  • 228
  • Not sure why you posted this answer. There is no question and this info has been posted in several other questions recently. – rmaddy Sep 18 '15 at 03:07
  • @rmaddy The title is a question and that is what people see when they are searching. Since it will probably not be deleted it will remain available. I went through "this is an answer" a while ago and by the rules that is allowed bordering on encouraged. But the answer lacked any real information. There were at least two other similar questions to day so it seems to be a current problem. Note: I down voted and voted to close as well. – zaph Sep 18 '15 at 03:22
  • No, the title is statement and the "question" is an answer. The OP posted a solution as a question. And it's about to be closed. What the OP should have done was posted an actual question and then posted their solution as an answer to their own question. But then the question would have been closed as a duplicate because this info has been asked and answered a few times lately. – rmaddy Sep 18 '15 at 03:25
  • And if you voted to close then why post an answer? I don't understand why someone would answer a bad question after they voted to close it. – rmaddy Sep 18 '15 at 03:27
  • Because the answer was poor and just closing it will not delete it. – zaph Sep 18 '15 at 03:28
  • FWIW, thank you for answering it @zaph. This was the first hit on my search and was very helpful. – ams Nov 10 '15 at 09:21