Skip to content

Instantly share code, notes, and snippets.

@onewayticket255
Created January 2, 2020 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onewayticket255/e933963fb4d3846eae24d948f1a35502 to your computer and use it in GitHub Desktop.
Save onewayticket255/e933963fb4d3846eae24d948f1a35502 to your computer and use it in GitHub Desktop.
Hook URLSession SSL Pinning
%hook URLSessionManager
-(void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler {
NSLog(@"Enter Into");
NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment