cfnetwork

How to configure CFStream (or NSStream) for SSL handshake?

断了今生、忘了曾经 提交于 2020-01-22 20:03:29
问题 I'm using CFStream/NSStream to make http connections. I want to be able to detect that a SSL handshake fails for three cases: case A: server is not trusted case B: server is trusted but asks a client certificate case C: server is not trusted and it asks a client certificate Today without doing anithing on the SSL Properties of my CFStream, I get: case A: error -9807 case B: no error but server refuses the connection (error 500) case C: error 9807 Is there a way to configure CFStream to

CFNetwork SSLHandshake failed (-9806) error using NSURLSession when app in background for an uploadTask

十年热恋 提交于 2020-01-21 04:54:11
问题 I am facing a CFNetwork SSL Handshake error while uploading a video file using NSURLSession UploadTask when the App is in background. There is no problem uploading the videos when the app is in foreground. Problem arises only when the app is in background. 回答1: Backgrounded NSURLSession 's handle a lot of things differently, including auth. I'd recommend you carefully read everything about background sessions and tasks in Apple's URL Loading System Programming Guide, particularly the section

How to include C static libraries in CMAKE project on MAC OS X

风格不统一 提交于 2020-01-11 07:39:08
问题 I am trying to learn Core Foundation with C/C++. I use JetBrains CLion that uses CMAKE. The problem is - I dunno how to include proper static libraries in C/C++ Makefile project on Mac. I need to link static library CFNetwork to my project in order to fix linking problems. Could you give me a quick hint? My case: #include <CFNetwork/CFNetwork.h> #include <iostream> int main() { CFStringRef bodyString = CFSTR(""); // Usually used for POST data CFDataRef bodyData =

dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate when trying to run iOS app

狂风中的少年 提交于 2020-01-08 17:11:31
问题 My app is crashing with the message: dyld: Symbol not found: _NSURLAuthenticationMethodClientCertificate Referenced from: /var/mobile/Applications/C7B596AD-FB09-4685-BDFC-7E955A5DD185/IRON TRAINERS.app/IRON TRAINERS Expected in: /System/Library/Frameworks/CFNetwork.framework/CFNetwork in /var/mobile/Applications/C7B596AD-FB09-4685-BDFC-7E955A5DD185/IRON TRAINERS.app/IRON TRAINERS (lldb) when I try to build and Run. When I remove the CFNetwork from my project, it works, I don't know why. I

CFNetwork internal error : URLConnectionLoader.cpp:289

喜夏-厌秋 提交于 2020-01-01 09:18:13
问题 When I open my application after a while, I received log: 440: CFNetwork internal error (0xc01a:/BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork/CFNetwork-758.4.3/Loading/URLConnectionLoader.cpp:289) It has never been out in the past. My project uses a network library AFNetworking and CocoaAsyncSocket. Why does it occur and how to fix it? 回答1: I solved my situation, it is not AFNetwork's issue, I use a invalid SSL certification and SDWebImage, when use the option

CFNetwork internal error : URLConnectionLoader.cpp:289

五迷三道 提交于 2020-01-01 09:18:07
问题 When I open my application after a while, I received log: 440: CFNetwork internal error (0xc01a:/BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork/CFNetwork-758.4.3/Loading/URLConnectionLoader.cpp:289) It has never been out in the past. My project uses a network library AFNetworking and CocoaAsyncSocket. Why does it occur and how to fix it? 回答1: I solved my situation, it is not AFNetwork's issue, I use a invalid SSL certification and SDWebImage, when use the option

CFNetworkCopyProxiesForAutoConfigurationScript causing many memory leaks

无人久伴 提交于 2019-12-24 00:52:04
问题 CFNetworkCopyProxiesForAutoConfigurationScript is Apple's native API, defined in CFNetwork framework.Whenever I call this API many memory leaks are left by this API and they keep on piling with each call to this API.I found it using "Instruments" and "View Memory Graph Heirarchy" option too. At the end it crashes due to memory issues. Below is the sample code that I am running. CFErrorRef err = NULL; NSString *strURL = @"http://www.google.com"; CFStringRef tempPacdata = CFStringCreateCopy

CFNetwork internal error: CFNetworkInternal.h:478

偶尔善良 提交于 2019-12-23 08:50:15
问题 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? 回答1: 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

How do i know if my client iOS app is connected to the server?

天大地大妈咪最大 提交于 2019-12-21 23:44:41
问题 I press the button to connect to the server (TCP), but i don't know whether it connected or not.. Here is that part of the code: [self connectToServerUsingCFStream:msg portNo:50000]; if(readStream && writeStream) { NSString *newText = [[NSString alloc] initWithFormat:@"Connected!! :)"]; statusText.text = newText; [newText release]; pingButton.hidden = NO; } else { NSString *newText = [[NSString alloc] initWithFormat:@"Connection unsuccessful :("]; statusText.text = newText; [newText release];

ios crash EXC_BAD_ACCESS KERN_INVALID_ADDRESS

耗尽温柔 提交于 2019-12-18 10:58:34
问题 MyApp works good in 98% of the time, But sometimes it shows a crash. And its so random. The crash report shows the following. Thread : Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x3b1ae626 objc_msgSend + 5 1 Foundation 0x310e2381 _netServiceMonitorCallBack + 104 2 CFNetwork 0x302ea3b5 _QueryRecordReply(_DNSServiceRef_t*, unsigned int, unsigned int, int, char const*, unsigned short, unsigned short, unsigned short, void const*, unsigned int, void*) + 324 3 libsystem_dnssd.dylib 0x3b7289d9