关于七牛云存储,HTTPS资源上传不成功问题
官方给出了一个解决方案,亲测可用。特此记录一下。
- 找到
QNConfiguration.m
文件。然后重写两个方法,直接上代码。
+ (instancetype)createWithHost:(NSString *)up backupHost:(NSString *)backup ip1:(NSString *)ip1 ip2:(NSString *)ip2
{
NSArray *ips = [NSArray arrayWithObjects:ip1, ip2, nil];
NSString *a = [NSString stringWithFormat:@"https://%@", up];
QNServiceAddress *s1 = [[QNServiceAddress alloc] init:a ips:ips];
NSString *b = [NSString stringWithFormat:@"https://%@", backup];
QNServiceAddress *s2 = [[QNServiceAddress alloc] init:b ips:ips];
return [[QNFixedZone alloc] initWithUp:s1 upBackup:s2];
}
+ (instancetype)zone0
{
static QNZone *z0 = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
z0 = [QNZone createWithHost:@"upload.qbox.me" backupHost:@"up.qbox.me" ip1:@"183.136.139.16" ip2:@"183.136.139.16"]; });
return z0;
}