nsurlconnection

Receiving SSL error in iOS7 GM - “AddTrust External CA Root” is not trusted?

你。 提交于 2019-11-30 15:41:11
I am receiving a SSL error in my NSURLConnection class, suddenly from iOS7 GM. I cannot access any of my APIs or webView pages, and is a severe emergency. Can anybody help me here? The error is as follows: NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) I've looked up the error, and it is explained as follows: errSSLNoRootCert = -9813, /* cert chain not verified by root */ My root certificate for my domain (confirmed via browser access) is "AddTrust External CA Root" . It is very unlikely that this is not trusted, because: This root certificate is even listed

NSURLConnection is returning old data

限于喜欢 提交于 2019-11-30 15:39:40
问题 In my application, I am loading JSON data using the NSURLConnection method, what looks like this: NSURLRequest *request = [[NSURLRequest alloc] initWithURL: [NSURL URLWithString:@"theurl"]]; NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; [theConnection start]; I receive and save the data in the -didReceiveData: method, but if I update my JSON file on my server, the NSURLConnection still delivers me the old JSON, while the file is uploaded

Multiple Requests on ASIHTTPRequest

半城伤御伤魂 提交于 2019-11-30 15:26:49
问题 I need to download three different sets of data from three different URLs. I decided to use ASIHTTPRequest. Two of the URLs are JSON feeds which I need to parse and one of them is a .txt file online that I need to store locally. Now the example that is on ASIHTTPRequest's website for an asynchronous request shows the following: - (IBAction)grabURLInBackground:(id)sender { NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url

NSURLConnection is returning old data

我的未来我决定 提交于 2019-11-30 15:20:18
In my application, I am loading JSON data using the NSURLConnection method, what looks like this: NSURLRequest *request = [[NSURLRequest alloc] initWithURL: [NSURL URLWithString:@"theurl"]]; NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; [theConnection start]; I receive and save the data in the -didReceiveData: method, but if I update my JSON file on my server, the NSURLConnection still delivers me the old JSON, while the file is uploaded correctly to the server. Only if I delete the whole app from my iPhone (or iPhone Simulator) and rebuild

iOS Cache Policy

半城伤御伤魂 提交于 2019-11-30 14:56:55
问题 I am doing a connection to the NSURL and I need to create a request to bypass all the cache policy. I have seen examples such as : NSURLRequest *request = [NSURLRequest requestWithURL:baseURL cachePolicy:0 timeoutInterval:10]; self.urlConnection = [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease]; May I ask what does the cache policy 0 refers to? Have tried searching for what the number represents but I'm not getting any answer I need. Thanks! :) 回答1: you should

Multiple Requests on ASIHTTPRequest

泄露秘密 提交于 2019-11-30 14:21:20
I need to download three different sets of data from three different URLs. I decided to use ASIHTTPRequest. Two of the URLs are JSON feeds which I need to parse and one of them is a .txt file online that I need to store locally. Now the example that is on ASIHTTPRequest's website for an asynchronous request shows the following: - (IBAction)grabURLInBackground:(id)sender { NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request startAsynchronous]; } To pass multiple URLs, I can call

How to cancel a persistent connection using NSURLConnection?

旧城冷巷雨未停 提交于 2019-11-30 12:40:48
问题 Is it possible to destroy a persistent connection that has been created with NSURLConnection? I need to be able to destroy the persistent connection and do another SSL handshake. As it is now, calling [conn cancel] leaves a persistent connection behind that gets used with the next connection request to that host, which I don't want to happen. 回答1: As it turns out, I believe the Secure Transport TLS session cache is to blame. I also asked the question on the apple developer forums, and got a

iOS, NSURLConnection: Delegate Callbacks on Different Thread?

故事扮演 提交于 2019-11-30 12:17:33
问题 How can I get NSURLConnection to call it's delegate methods from a different thread instead of the main thread. I'm trying to mess around with the scheduleInRunLoop:forMode:but doesn't seem to do what I want. I have to download a large file and it interrupts the main thread so frequently that some rendering that is happening starts getting choppy. NSURLRequest * request = [NSURLRequest requestWithURL:url]; NSURLConnection * connection = [[NSURLConnection alloc] initWithRequest:request

iphone nsurlconnection read cookies

陌路散爱 提交于 2019-11-30 11:59:38
I am using async NSURLConnection to connect to a web site from iPhone. Handle didReceiveResponse is activated on response and I am trying to get all cookies, by using allHeaderFields from NSHTTPURLResponse I see many hreader, but no Set-Cookie - it looks like iphone simulator just ignores them... And I am sure cookies are present in response - network monitor shows they present I do not use any http storage - all that I am trying to do is to print to log all header - and do not see cookies info Does anybody know about this issue? UPDATE I have made some research: if my website returns custom

Getting data out of the NSURLResponse completion block

醉酒当歌 提交于 2019-11-30 11:09:40
问题 It looks like I didn't get the concept of blocks completely yet... In my code I have to get out the JSON data from the asychronous block to be returned to from the ' outer ' method. I googled and found that if defining a variable with __block , the v̶i̶s̶i̶b̶i̶l̶i̶t̶y̶ _mutability_ of that variable is extended to the block . But for some reason returned json object is nil.I wonder why? - (NSMutableDictionary *)executeRequestUrlString:(NSString *)urlString { __block NSMutableDictionary *json =