I have added the "ASIHTTPRequest" library to my app. Now, I'm trying to remove all warnings in my project. I have fixed all other warnings except those for "ASIHTTPRequest". I'm getting the warnings below.
'kCFStreamSSLAllowsExpiredCertificates' is deprecated:
'kCFStreamSSLAllowsAnyRoot' is deprecated:
How to resolve this?
Code:
NSDictionary *sslProperties = [[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithBool:YES], kCFStreamSSLAllowsExpiredCertificates,
[NSNumber numberWithBool:YES], kCFStreamSSLAllowsAnyRoot,
[NSNumber numberWithBool:NO], kCFStreamSSLValidatesCertificateChain,
kCFNull,kCFStreamSSLPeerName,
nil];
As per the comments in CFSocketStream.h in the CFNetwork framework:
So the simple solution is to remove the deprecated keys and their values. Keep only
kCFStreamSSLValidatesCertificateChain
andkCFStreamSSLPeerName
in thesslProperties
dictionary.Add the following line above your declaration: