Reputation: 1189
Our backend is in rails, and for several reasons the development environment has to be run with rails using a self-signed SSL certificate. This works fine on the desktop after manually trusting the certificate.
Using Trigger.io, we're developing a mobile application targeting iOS from the same backend. It would be ideal for us to be able to run the rails server with SSL (so we can compare the browser output) and still have the iOS simulator connect properly without complaining about invalid certs.
Production is using a proper ssl-cert, but what's the best way to set up the simulator?
Upvotes: 4
Views: 997
Reputation: 2540
You can try installing the CRT file on the device like this:
Push your CRT file to a server which your device can access to
On the device, browse to http://example.com/certificate.crt then install the certificate.
This is similar to how you could debug SSL with proxy as described here
Upvotes: 2
Reputation: 3637
For testing purposes, you can create a category around NSURLRequest that ignores certificates:
@implementation NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host
{
return YES;
}
@end
This obviously can't be submitted to the app store, and shouldn't be used in production.
Upvotes: 0