Last active
February 7, 2017 02:03
-
-
Save takeshiyako2/8e21d062090a6f8b97dbb58a3e6e0c44 to your computer and use it in GitHub Desktop.
iOS Objective-C against kCFStreamErrorDomainSSL error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSExceptionDomains</key> | |
<dict> | |
<key>mydomain.com</key> | |
<dict> | |
<key>NSIncludesSubdomains</key> | |
<true/> | |
<key>NSExceptionRequiresForwardSecrecy</key> | |
<false/> | |
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> | |
<true/> | |
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key> | |
<false/> | |
</dict> | |
</dict> | |
</dict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2017-02-07 10:49:25.250 App[46178:1264401] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) | |
2017-02-07 10:49:25.253 App[46178:1264332] FADHttp failed -1200: https://mydomain/ An SSL error has occurred and a secure connection to the server cannot be made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#ifdef DEBUG | |
@interface NSURLRequest (SSL) | |
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host; | |
@end | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSURLRequestOverrideNotSecureSSL.h" | |
#ifdef DEBUG | |
@implementation NSURLRequest(SSL) | |
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host { | |
return YES; | |
} | |
@end | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment