I'm trying to use [sendSynchronousRequest: returningResponse: error:]
code for connecting server, but the certificate is untruested which provides an error. I have already read
How to use NSURLConnection to connect with SSL for an untrusted cert?. But i couldn't figure out how should i set the delegate if i am not using [initWithRequest:delegate:]
method. Or is there any way to use 'synchronous request'? (Otherwise i need to block process until it receives any result)
Asked
Active
Viewed 717 times
2
1 Answers
1
you should use the [initWithRequest:delegate:]
method.
In the NSURLConnection manual you have:
If authentication is required in order to download the request, the required credentials must be specified as part of the URL. If authentication fails, or credentials are missing, the connection will attempt to continue without credentials.
Similar issues happens with invalid SSL certificates

ppaulojr
- 3,579
- 4
- 29
- 56
-
Isn't there any way to provide synchronous connection, cuz i have to use the responde to save a managed object which will be used in another connection. So if we consider that these two connections in NSOperationQueue as a NSOperation, i need to block the queue until delegate receive the respond. – CanP Oct 18 '11 at 15:41
-
Usually doing stuff in an Async way is harder but it pays off on the long run – ppaulojr Oct 18 '11 at 15:44