0
votes

When I access website API using https, the ASIHTTPRequest can't get response. I got the error below:

ASI error:: Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred: SSL problem (possibly a bad/expired/self-signed certificate)" UserInfo=0x4e5ccd0 {NSUnderlyingError=0x4e5ce40 "The operation couldn’t be completed. (OSStatus error -9807.)", NSLocalizedDescription=A connection failure occurred: SSL problem (possibly a bad/expired/self-signed certificate)}


I guess I got this error because I generated the SSL certificate by myself, instead of purchasing one. Is that right? Does "SSL problem (possibly a bad/expired/self-signed certificate)} " mean i should purchase a SSL certificate for my server?

1
possible duplicate of ASIHTTPRequest: https with SSLJosephH

1 Answers

1
votes

You're correct, a self-signed SSL Cert will cause this error. That said, you're not forced to purchase an SSL Cert.

If this were for an internal application, I'd just disable the Cert check with the following:

[request setValidatesSecureCertificate:NO];