请问能否提供利用GCDAsyncSocket 建立https的长连接的相关code,多谢~
FrankCYQ opened this issue · 0 comments
FrankCYQ commented
-(void)socket:(GCDAsyncSocket *)socket didConnectToHost:(NSString *)host port:(uint16_t)port{
NSMutableDictionary *settings = [[NSMutableDictionary alloc] init];
[settings setObject:[NSNumber numberWithBool:YES]
forKey:GCDAsyncSocketManuallyEvaluateTrust];
[self.socket startTLS:settings];
}
在原有基础上增加上面代码,还是无法正常访问https server,
- (void)socket:(GCDAsyncSocket *)sock didReceiveTrust:(SecTrustRef)trust completionHandler:(void (^)(BOOL))completionHandler
这个回调方法不执行···
多谢