// We'll use a custom error message for common SSL errors, but you should always check underlying error if you want more details
// We'll use a custom error message for SSL errors, but you should always check underlying error if you want more details
// For some reason SecureTransport.h doesn't seem to be available on iphone, so error codes hard-coded
// Also, iPhone seems to handle errors differently from Mac OS X - a self-signed certificate returns a different error code on each platform, so we'll just provide a general error
GHAssertNotNil([requesterror],@"Failed to generate an error for a self-signed certificate");
// Just for testing the request generated a custom error description - don't do this! You should look at the domain / code of the underlyingError in your own programs.
BOOLsuccess=([[[requesterror]localizedDescription]isEqualToString:@"A connection failure occurred: Secure certificate had an untrusted root"]);
BOOLsuccess=([[[requesterror]localizedDescription]isEqualToString:@"A connection failure occurred: SSL problem (possibily a bad/expired/self-signed certificate)"]);
GHAssertTrue(success,@"Generated the wrong error for a self signed cert");