Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CFNetwork internal error: CFNetworkInternal.h:478

My iOS device logs (on simulator and real devices) was filled with a couple dozen lines of the following error spam:

CFNetwork internal error (0xc01a:/BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork_Sim/CFNetwork-758.0.2/ProjectRuntime/CFNetworkInternal.h:478)

Why am I seeing these, and how do I get rid of them?

like image 382
Mike Lambert Avatar asked Oct 08 '15 21:10

Mike Lambert


1 Answers

Turns out this was due to an incorrect setup in my Info.plist's NSAppTransportSecurity.

Make sure that for each of the NSExceptionDomains you use, the subfields of the dictionary (such as NSIncludesSubdomains, NSExceptionRequiresForwardSecrecy, and NSExceptionAllowsInsecureHTTPLoads) are set to type Boolean, not String. While XCode may display your values of YES and NO very similarly, the type is important for ensuring CFNetwork is able to understand your config without any errors.

Incorrect: Incorrect setup

Correct: Correct setup

like image 75
Mike Lambert Avatar answered Sep 22 '22 20:09

Mike Lambert