How can I remove the deprecated API warnings from my SSL properties

718 views Asked by At
 NSDictionary *sslProperties = [[NSDictionary alloc] initWithObjectsAndKeys:
                                  [NSNumber numberWithBool:YES], kCFStreamSSLAllowsExpiredCertificates,
                                  [NSNumber numberWithBool:YES], kCFStreamSSLAllowsAnyRoot,
                                  [NSNumber numberWithBool:NO],  kCFStreamSSLValidatesCertificateChain,
                                  kCFNull,kCFStreamSSLPeerName,
                                  nil];

These keys are deprecated

kCFStreamSSLAllowsExpiredCertificates
kCFStreamSSLAllowsAnyRoot

How can I fix it so I'm not using deprecated API/keys.

I saw this 'kCFStreamSSLAllowsExpiredCertificates' and 'kCFStreamSSLAllowsAnyRoot' is deprecated

but I didn't understand the popular response

1

There are 1 answers

0
Moonhead On BEST ANSWER

You should remove kCFStreamSSLAllowsExpiredCertificates and kCFStreamSSLAllowsAnyRoot from your NSDictionary because it is not required anymore.