I have found the code not correctly supported https(SSL) server on device or
simulator, it reports kCFStreamErrorDomainSSL error when connect to https(SSL)
server, i do the following to fix it.
At openStream before calling CFReadStreamOpen, add the following code to not
check SSL:
if (requestStream) {
// We don't want to validate the HTTPS certificate.
CFMutableDictionaryRef securityDictRef = CFDictionaryCreateMutable (kCFAllocatorDefault,
0 ,
& kCFTypeDictionaryKeyCallBacks,
& kCFTypeDictionaryValueCallBacks);
if (securityDictRef != NULL ){
CFDictionarySetValue (securityDictRef, kCFStreamSSLValidatesCertificateChain, kCFBooleanFalse);
CFReadStreamSetProperty (requestStream, kCFStreamPropertySSLSettings , securityDictRef);
CFRelease (securityDictRef);
}
}
Original issue reported on code.google.com by bygree...@gmail.com on 8 Feb 2011 at 8:26
Original issue reported on code.google.com by
bygree...@gmail.com
on 8 Feb 2011 at 8:26