Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App Transport Security verbose

Is there a way to make App transport security more verbose? When my app makes an http call I will get notified in the Xcode console. However it doesn't tell me which http request is triggering the app transport security warning.

Is there a way to make the warning more verbose such that it includes the URL that triggered the warning?

like image 667
DerrickHo328 Avatar asked Oct 30 '25 01:10

DerrickHo328


1 Answers

You can get this information by bumping up the CFNETWORK_DIAGNOSTICS level

You can set it in your scheme's environment variables like so:

enter image description here

Or you can set it in your code (somewhere like at the beginning of main, for example) or even in your applicationDidFinishLoadingWithOptions. The code to increase the network logging is:

setenv("CFNETWORK_DIAGNOSTICS", "3", 1);

The Xcode console shows the location of the log file:

CFNetwork diagnostics log file created at: /private/var/mobile/Containers/ Data/Application/C1A9DD23-B11E-F39A-E73A-5D837B2B2238/Library/Logs/ CrashReporter/CFNetwork_com.wottle.TestApp_821.nwlrb.log

like image 191
wottle Avatar answered Oct 31 '25 17:10

wottle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!