As far as I know, you cannot do this with a synchronous request. At least not with NSURLConnection. You can use ASIHTTPRequest and it will look like this:
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setValidatesSecureCertificate:NO] [request startSynchronous];
When it comes to third-party libraries, AFNetworking can do this (in several ways) and it also has the ability to work synchronously.
#ifdef DEBUG #define _AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_ #endif
Last but not least, you can do it at a low level and using CFNetworking itself (you can see the ASIHTTPRequest code how to do it), but it will probably add more boilerplate code than using NSURLConnectionDelegate.
I also mentioned third-party libraries because they use different approaches to asynchronizing HTTP requests. I urge you to take a look at them because they can better match the reasons why you do not want to use NSURLConnectionDelegate.
source share