CFWriteStreamSetProperty为kCFStreamPropertySSLSettings返回false

时间:2010-11-04 22:54:20

标签: iphone sockets networking ssl ios

嘿,我正在尝试为我的服务器协议设置SSL。无论如何,当我去设置kCFStreamPropertySSLSettings时,它返回false。不知道为什么。

这是我的sslDict:

2010-11-04 15:48:59.742
bytestest[30897:207] sslDict = {
    kCFStreamSSLAllowsAnyRoot = 1;
    kCFStreamSSLAllowsExpiredCertificates = 1;
    kCFStreamSSLAllowsExpiredRoots = 1;
    kCFStreamSSLCertificates =     (
        "<SecIdentityRef: 0x792ede0>",
        "<SecTrustRef: 0x792f220>"
    );
    kCFStreamSSLLevel = kCFStreamSocketSecurityLevelNegotiatedSSL;
}

这是我正在谈论的代码:

isPropertySet = CFWriteStreamSetProperty(writeStream,
                                         kCFStreamPropertySSLSettings, 
                                         sslDict);  

此行后isPropertySet设置为false

谢谢!

1 个答案:

答案 0 :(得分:0)

我放置了证书本​​应该存在的信任!