sgrove
sgrove

Reputation: 1189

How to use a self-signed SSL certificate when developing with Trigger.io?

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

Answers (2)

Alon Burg
Alon Burg

Reputation: 2540

You can try installing the CRT file on the device like this:

This is similar to how you could debug SSL with proxy as described here

Upvotes: 2

Mike Sprague
Mike Sprague

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

Related Questions