简体   繁体   中英

Import a self-signed certificate onto my iPhone

I am developing an app that uses SSL to communicate with my server.

The connection keeps failing with The certificate for this server is invalid. You might be connecting to a server that is pretending to be (removed.com) which could put your confidential information at risk. The certificate for this server is invalid. You might be connecting to a server that is pretending to be (removed.com) which could put your confidential information at risk.

I've tried emailing the certificate to myself and importing it on my iphone, but the error still occurs.

Even visiting the webpage through safari, it warns me and asks if I want to accept the certificate.

How can I just get my iphone to ignore the invalid certificate? It's really annoying!

Thanks!

The problem you are describing sounds like a wrong configuration of your server certificate. Are you sure, that the certificate is not expired, matches the domain (or subdomain) and is valid.

For a quick try and for development purposes you could use the following workaround for UIWebView and standard connections. ( Attention : This will be rejected from App Store):

[NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[url host]];

If you can specify the type of connection you are using or post some code we could possibly find a way to disable the SSL verification.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM