Skip to content

Instantly share code, notes, and snippets.

@vhyrbi
vhyrbi / SSLHelper.m
Last active February 13, 2022 10:59
iOS - How to add HTTPS support for one's own Certificate Authority
#import <Security/Security.h>
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
@interface SSLHelper : NSObject
+ (SSLHelper *)sharedInstance;
- (void) addCertToKeychain:(NSData*)certInDer;
- (BOOL) canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace;
- (BOOL) manageAuthorizationForChallenge:(NSURLAuthenticationChallenge*)challenge;