企业优惠唯一官方(www.qyyh.com)- 实用的企业优惠信息大全

手机版 网站地图 txt地图 html地图

域名ssl分类
热门标签:
最新标签:

如何在iPhone上创建一个SSL链接?

日期:2022/10/27 11:19作者:人气:

导读:...

if(secured){ [NSStream getStreamsToHost:host port:443 inputStream:&input outputStream:&output]; } [input setDelegate:self]; [output setDelegate:self]; [input scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; [output scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; if(secured){ [input setProperty:NSStreamSocketSecurityLevelTLSv1 forKey:NSStreamSocketSecurityLevelKey]; [output setProperty:NSStreamSocketSecurityLevelTLSv1 forKey:NSStreamSocketSecurityLevelKey]; NSMutableDictionary* sslSettings; sslSettings = [NSMutableDictionary dictionaryWithObjectsAndKeys:(id)kCFBooleanFalse, kCFStreamSSLValidatesCertificateChain, kCFBooleanFalse, kCFStreamSSLIsServer, nil]; BOOL success = (sslSettings != nil); success = CFWriteStreamSetProperty((CFWriteStreamRef)output, kCFStreamPropertySSLSettings, sslSettings); } [input open]; [output open];

网站地图

Copyright © 2022-2023 qyyh.com 企业优惠网 版权所有 工信部备案号:蜀ICP备19014027号-8

声明: 企业优惠