mlewis54
mlewis54

Reputation: 2380

iOS HTTPS possible communication problem

My server certificate expired a couple of days ago and my app (which communicates with the server over HTTPS) crashes now (unable to connect). It is a simple synchronous post https call. The program is never run on the server. The access is never logged in the Apache log. This leads me to believe that the expired certificate is the problem. Nothing in the code on the server or the app has changed in 3 weeks.

Is there a way to set a flag that says that the certificate doesn't have to valid in order to make the connection?

Upvotes: 1

Views: 2249

Answers (1)

chilitechno.com
chilitechno.com

Reputation: 1575

You can do it in a non-private API manner if you're using ASIHTTPRequest.

   NSURL *url = [NSURL URLWithString:@"https://www.google.com"];
   ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]

[request setValidatesSecureCertificate:NO];

Or see this answer (using NSURLConnection delegate)

HTTPS with NSURLConnection - NSURLErrorServerCertificateUntrusted

Upvotes: 1

Related Questions