TencentCloud / httpdns-sdk-ios

智营防劫持SDK
151 stars 43 forks source link

3. SNI(单IP多HTTPS证书)场景下使用HttpDns解析结果 #4

Closed qiusuo8 closed 7 years ago

qiusuo8 commented 7 years ago

demo中使用https的域名测试,两种情况均返回: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

httpdns commented 7 years ago

可以把URL发给我测试下吗?

qiusuo8 commented 7 years ago

@httpdns
NSString originalUrl = @"https://upms.startimestv.com/cms/app/myApp?version=122"; NSURL url = [NSURL URLWithString:originalUrl]; NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url]; [request setValue:@"4ec3b3b8ad91a41ec3a98b878ce1f098" forHTTPHeaderField:@"token"];

httpdns commented 7 years ago

我这边测试是ok的,能拿到结果:{"status":"Deleted","id":141,"description":"2.0","createDate":1501810593000,"version":122,"forceUpdate":false,"apkSize":8.0,"dataVersion":61,"questionActive":false,"apkUrl":"","versionType":0,"posterUrl":""} 不知道是不是没有在info.plist里设置“Hijack_Domain”,如果没有设置的话,默认就不走这个方案的。

qiusuo8 commented 7 years ago

@httpdns 是的,没有在info.plist里设置“Hijack_Domain”,感谢