简体   繁体   English

App Transport Security详细

[英]App Transport Security verbose

Is there a way to make App transport security more verbose? 有没有办法让App传输安全性更加冗长? When my app makes an http call I will get notified in the Xcode console. 当我的应用程序进行http调用时,我将在Xcode控制台中收到通知。 However it doesn't tell me which http request is triggering the app transport security warning. 但是,它没有告诉我哪个http请求触发了应用程序传输安全警告。

Is there a way to make the warning more verbose such that it includes the URL that triggered the warning? 有没有办法让警告更详细,以便它包含触发警告的URL?

You can get this information by bumping up the CFNETWORK_DIAGNOSTICS level 您可以通过提高CFNETWORK_DIAGNOSTICS级别来获取此信息

You can set it in your scheme's environment variables like so: 你可以在你的方案的环境变量中设置它,如下所示:

在此输入图像描述

Or you can set it in your code (somewhere like at the beginning of main , for example) or even in your applicationDidFinishLoadingWithOptions . 或者您可以在代码中设置它(例如,在main的开头,或者甚至在您的applicationDidFinishLoadingWithOptions The code to increase the network logging is: 增加网络日志记录的代码是:

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

The Xcode console shows the location of the log file: Xcode控制台显示日志文件的位置:

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 CFNetwork诊断日志文件创建于:/ private / var / mobile / Containers / Data / Application / C1A9DD23-B11E-F39A-E73A-5D837B2B2238 / Library / Logs / CrashReporter / CFNetwork_com.wottle.TestApp_821.nwlrb.log

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM