MugunthKumar/MKStoreKit — Issue #58: https query to api server [SSL implementation]
Author: chepil
Created: 2012-03-09 19:13:52+00:00
State: open

I suggest add next feature -
If you add to MKStoreKitConfigs.h this -
#define OWN_SERVER @"https://address_your_server/api"
you will trouble with connection by SSL protocol.

You can do that -
Change MKSKProduct.m,
add to it this block -
// Dummy interface to avoid a warning.
@interface NSURLRequest (DummyInterface)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
+ (void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
@end

Then change procedure, for example -

+(void) verifyProductForReviewAccess:(NSString*) productId
onComplete:(void (^)(NSNumber*)) completionBlock
onError:(void (^)(NSError*)) errorBlock

....
[theRequest setHTTPMethod:@"POST"];
[theRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];

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

...
}

As you see, I'm add this - [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[url host]];

Do the same with
- (void) verifyReceiptOnComplete:(void (^)(void)) completionBlock
onError:(void (^)(NSError*)) errorBlock