Skip to content

请问能否提供利用GCDAsyncSocket 建立https的长连接的相关code,多谢~ #9

Description

@FrankCYQ

-(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
    这个回调方法不执行···
    多谢

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions