cfnetwork

Using SSLSetEnabledCiphers with AFNetworking to disable weak ciphers

╄→尐↘猪︶ㄣ 提交于 2019-12-04 21:20:15
问题 I am trying to disable some ciphers (weak) such as single DES, single DES 40 bit etc. I've tried using this bit of code from How does one set SSL ciphers when using CFSocket/CFStream in Cocoa? and from mailing list message CFNetwork SSL and long blocking delays but I need access to socket data to get the CFDataRef . Here is the code that I tried to insert in the handshake method in AFURLConnectionOperation class: - (void)connection:(NSURLConnection *)connection

Creating and binding socket on Mac OS Hight Sierra

孤街浪徒 提交于 2019-12-04 12:23:43
I have serious and strange problem with creating socket in my application for Hight Sierra. If I create command Line tool, everything is ok! I create socket, bind socket. But If I trying to create Cocoa App, I can't binding my socket! :( If I use CFSockets in Cocoa App, char punchline[] = "MESSAGE from Server!"; int yes = 1; CFSocketContext CTX = {0, punchline, NULL, NULL, NULL}; CFSocketRef TCPServer = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP, kCFSocketAcceptCallBack, (CFSocketCallBack) &AcceptCallBack, &CTX); if (TCPServer == NULL) return; setsockopt

CFNetwork internal error : URLConnectionLoader.cpp:289

时光怂恿深爱的人放手 提交于 2019-12-04 04:01:36
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? I solved my situation, it is not AFNetwork's issue, I use a invalid SSL certification and SDWebImage, when use the option 'SDWebImageAllowInvalidSSLCertificates' in SDWebImage and get a http image (not https image), you will get this error. the

Using SSLSetEnabledCiphers with AFNetworking to disable weak ciphers

不打扰是莪最后的温柔 提交于 2019-12-03 12:49:59
I am trying to disable some ciphers (weak) such as single DES, single DES 40 bit etc. I've tried using this bit of code from How does one set SSL ciphers when using CFSocket/CFStream in Cocoa? and from mailing list message CFNetwork SSL and long blocking delays but I need access to socket data to get the CFDataRef . Here is the code that I tried to insert in the handshake method in AFURLConnectionOperation class: - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge (NSURLAuthenticationChallenge *)challenge{ CFReadStreamRef stream = [sock getCFReadStream];

How to retrieve the ssl server certificate in iOS?

大城市里の小女人 提交于 2019-12-03 10:14:47
问题 I'd like to be able to get the ssl certificate (+chain if possible) to be able to display the distinguished name and to determine if it is an EV certificate. (detecting EV certs via certificate policies (wikipedia) From what I've seen you only get presented with some certificate details if the certificate is self-signed. Is it possible using lower layers like CFNetwork to retrieve the certificate(s)? 回答1: via the macnetworkprog.lists.apple.com mailing list http://web.archiveorange.com/archive

How to inspect websocket traffic with charlesproxy for iOS simulator/devices

旧时模样 提交于 2019-12-02 16:14:22
I would like to inspect network traffic going through web sockets , I have no control over the networking code as this is a binary lib for which I do not have the source code, so I cannot do any log/breakpoint in the networking part of the code. I have tried using the latest version of CharlesProxy which claim to be able to sniff websockets however when I tried the url and apis using websockets were not even mentionned in the list of endpoints called from my iPhone. I have verified that CharlesProxy is configured correctly as I am able to inspect non-websocket traffic even under SSL. So my

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

孤街浪徒 提交于 2019-12-01 14:23:24
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 = CFStringCreateExternalRepresentation(kCFAllocatorDefault, bodyString, kCFStringEncodingUTF8, 0); CFStringRef headerFieldName = CFSTR

How To Monitor Network Activity From Within App?

 ̄綄美尐妖づ 提交于 2019-11-29 22:40:07
I'm trying to monitor network activity on my iPhone from within an app I'm developing. Does iOS support a netstat-like command or something similar that can tell me what what inbound and outbound connections are active ? After some searching I found Apple's code used for netstat . Everything you need in the void protopr(uint32_t proto, char *name, int af) function. I tested on the device and sysctlbyname("net.inet.tcp.pcblist_n",...) works. That should be all you need. I can't test this but from what I gather you will have to use sysctl in combination with sysctlnametomib or alternatively

A list of linking CFNetwork version numbers to the version of iOS

别说谁变了你拦得住时间么 提交于 2019-11-29 19:59:36
I'm wondering if anyone has a list of linking CFNetwork version numbers to the version of iOS? I've found the list for OSX CFNetwork versions but it's quite old. Reuben Bijl I made this list from some of the devices I had around at the time. It's not complete but hopefully it is helpful for someone else. Device OS CFNetwork Version iPod Touch 2G 3.1.3 CFNetwork/459 Darwin/10.0.0d3 iPod Touch 3G 4.0 CFNetwork/485.2 Darwin/10.3.1 iPhone 3GS 4.1 CFNetwork/485.10.2 Darwin/? iPhone 3G 4.2.1 CFNetwork/485.12.7 Darwin/10.4.0 iPhone 4 4.3.2 CFNetwork/485.13.9 Darwin/? iPod Touch 4G 4.3.5 CFNetwork/485

How could I curl for a request with headers in shell scripting

谁说我不能喝 提交于 2019-11-29 15:40:53
I tried to execute a CURL statement as follows, for which I am getting required response: curl -s -POST --header 'Content-Type: application/json' 'http://www.dummy.com/projectname/page_relevance' -d '{"query": "q_string", "results": [{"abstract": "abs_string", "title": "title_string"}, "mode": "value", "cache": true, "source": "value"}' But when i tried to pass variable values to parameter "query", the curl statement mentioned below not works and observed some error statement in response: curl -s -POST --header 'Content-Type: application/json' 'http://www.dummy.com/projectname/page_relevance'