[self.syncListener setPasswords:@{self.documentID: self.syncPasswordFromKeychain}];
- (NSURL *)peerURLWithSSL:(BOOL)ssl {
NSURLComponents *components = [[NSURLComponents alloc] init];
components.scheme = (ssl ? @"https" : @"http");
components.host = self.service.hostName;
components.port = @(self.service.port);
components.path = [@"/" stringByAppendingString:self.databaseDocument.documentID];
if (self.databaseDocument.syncPasswordFromKeychain) {
components.user = self.databaseDocument.documentID;
components.password = self.databaseDocument.syncPasswordFromKeychain;
}
return components.URL;
}
/** Authenticates a request that uses Basic or Digest authentication.
If this method is not implemented, the `passwords` dictionary registered with the CBLListener
is consulted instead. **/
- (BOOL)isPasswordProtected:(NSString *)path {
return !_hasClientCert && self.listener.requiresAuth;
}
BOOL success = [self.syncListener setAnonymousSSLIdentityWithLabel:@"tf-peer-sync" error:&error];
On Jan 8, 2016, at 12:11 PM, Brendan Duddridge <bren...@gmail.com> wrote:
I do want encrypted traffic but I also want password authentication, which I hope should be secure enough as long as the traffic is going over SSL. But it would seem that you can't have password authentication if you also have encryption.