Ah, I missed that link, Thanks, Jens! As far as I can tell all docs could be better, mine certainly!
I’ve turned on logging for code that works well without SSL, but which doesn’t seem to work for SSL. Here is the output during start, just here for completeness. I changed my path to //…DBpath…// and this method handles connections and disconnections and replication in my Repository class.Oh, it deletes the local database if in debug mode, as it is here.
16:29:26.677| CBLDatabase: Created CBLManager[0x7feec2d48dc0 //..DBpath..//]
16:29:26.678| CBLDatabase: CBLManager[0x7feec2d48dc0 //..DBpath..//] is the sharedInstance
16:29:26.679| CBLDatabase: Opening CBLDatabase[<0x7feec2c3da60>ts1]
16:29:26.679| CBLDatabase: Open //..DBpath..///ts1.cblite (flags=200006)
-[Repository connectTo:withDatabase:] [Line 164] #$#$#$[[ ERASING APP LOCAL DATABASE ]]#$#$#$
16:29:26.682| CBLDatabase: Deleting //..DBpath..///ts1.cblite
16:29:26.682| CBLDatabase: Closing <0x7feec2c3da60> //..DBpath..///ts1.cblite
16:29:26.683| CBLDatabase: Deleted file //..DBpath..///ts1.cblite
16:29:26.684| CBLDatabase: Deleted file //..DBpath..///ts1 attachments
-[Repository connectTo:withDatabase:] [Line 178] Connecting to Server database....
16:29:26.685| CBLDatabase: Opening CBLDatabase[<0x7feec2e2f8c0>ts1]
16:29:26.685| CBLDatabase: Open //..DBpath..///ts1.cblite (flags=200006)
16:29:39.970| CBLDatabase: Created CBLManager[0x7feec2c4a6f0 //..DBpath..//]
16:29:39.971| CBL_Server: CBL_Server[0x7feec2c4a9b0] Starting server thread ...
16:29:39.971| CBLDatabase: CBLManager[0x7feec2d48dc0 //..DBpath..//] created CBL_Server[0x7feec2c4a9b0] (with CBLManager[0x7feec2c4a6f0 //..DBpath..//])
At this point the code has created the database from CBLManager and has just set up the replication and hooked up notifications to my replicationProgress method and will exit:
16:29:39.971| Sync: CBLReplication[to https://192.168.1.13:6984/ts1/]: offline, progress = 0 / 0, err: (null)
-[Repository replicationProgress:] [Line 278] ****** pullReplication is stopped. ******
-[Repository replicationProgress:] [Line 292] pushReplication is offline.
16:29:39.971| Sync: CBLReplication[from https://192.168.1.13:6984/ts1/]: offline, progress = 0 / 0, err: (null)
16:29:39.971‖ CBL_Server: CBL_Server[0x7feec2c4a9b0]: Server thread starting...
-[Repository replicationProgress:] [Line 280] pullReplication is offline.
-[Repository replicationProgress:] [Line 292] pushReplication is offline.
-[Repository connectTo:withDatabase:] [Line 220] Connection method finished
At about this point the replicationProgress reports that both are active as they pull down a few hundred items. The address is the database, ts1. If I post this into a browser I get the expected JSON response, after accepting the certificate. So, I suspect that my certificate isn’t being found. I don’t see any complaints when, during class init, I add the certs as suggested above by pasin, like this: [CBLReplication setAnchorCerts:certs onlyThese:NO];
Here is what follows. My expectation is that the replication will pull in the docs and I’ll see some logging in my replicationProgress method. Any ideas? How can I verify the certificates are being added/used/tried?
16:29:39.973‖ CBLDatabase: Opening CBLDatabase[<0x7feec2d4c430>ts1]
16:29:39.973‖ CBLDatabase: Open //..DBpath..///ts1.cblite (flags=200006)
16:29:39.975‖ Sync: CBL_Pusher[https://192.168.1.13:6984/ts1/] STARTING ...
16:29:39.978‖ Sync: CBL_Pusher[https://192.168.1.13:6984/ts1/]: Reachability state = <192.168.1.13>:reachable (30002), suspended=0
16:29:39.979‖ Sync: CBL_Pusher[https://192.168.1.13:6984/ts1/]: Going online
16:29:39.990‖ Sync: CBL_Pusher[https://192.168.1.13:6984/ts1/] Progress: set active = 1
16:29:39.991‖ SyncVerbose: CBL_Pusher[https://192.168.1.13:6984/ts1/]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
16:29:39.991‖ SyncVerbose: CBL_Pusher[https://192.168.1.13:6984/ts1/]: GET _local/901a6485814f57adff63a01698416375192e5547
16:29:39.991‖ RemoteRequest: CBLRemoteJSONRequest[GET https://192.168.1.13:6984/ts1/_local/901a6485814f57adff63a01698416375192e5547]: Starting...
16:29:39.991‖ SyncVerbose: CBL_Pusher[https://192.168.1.13:6984/ts1/]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
16:29:39.992‖ Sync: CBL_Puller[https://192.168.1.13:6984/ts1/] STARTING ...
16:29:39.994‖ Sync: CBL_Puller[https://192.168.1.13:6984/ts1/]: Reachability state = <192.168.1.13>:reachable (30002), suspended=0
16:29:39.994‖ Sync: CBL_Puller[https://192.168.1.13:6984/ts1/]: Going online
16:29:39.994‖ Sync: CBL_Puller[https://192.168.1.13:6984/ts1/] Progress: set active = 1
16:29:39.994‖ SyncVerbose: CBL_Puller[https://192.168.1.13:6984/ts1/]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
16:29:39.994‖ SyncVerbose: CBL_Puller[https://192.168.1.13:6984/ts1/]: GET _local/2197320788ddbd84be29d3458108bc0473680b5a
16:29:39.994‖ RemoteRequest: CBLRemoteJSONRequest[GET https://192.168.1.13:6984/ts1/_local/2197320788ddbd84be29d3458108bc0473680b5a]: Starting...
16:29:39.994‖ SyncVerbose: CBL_Puller[https://192.168.1.13:6984/ts1/]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
16:29:40.001‖ RemoteRequest: CBLRemoteJSONRequest[GET https://192.168.1.13:6984/ts1/_local/901a6485814f57adff63a01698416375192e5547]: Got response, status 404
16:29:40.001‖ Sync: CBL_Pusher[https://192.168.1.13:6984/ts1/]: Replicating from lastSequence=(null)
16:29:40.002‖ SyncVerbose: CBL_Pusher[https://192.168.1.13:6984/ts1/]: Received 0 revs
16:29:40.003‖ Sync: CBL_Pusher[https://192.168.1.13:6984/ts1/] Progress: set active = 0
16:29:40.003‖ SyncVerbose: CBL_Pusher[https://192.168.1.13:6984/ts1/]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
16:29:40.004‖ RemoteRequest: CBLRemoteJSONRequest[GET https://192.168.1.13:6984/ts1/_local/2197320788ddbd84be29d3458108bc0473680b5a]: Got response, status 404
16:29:40.004‖ Sync: CBL_Puller[https://192.168.1.13:6984/ts1/]: Replicating from lastSequence=(null)
16:29:40.004‖ SyncVerbose: CBL_Puller[https://192.168.1.13:6984/ts1/] starting ChangeTracker: mode=0, since=(null)
16:29:40.005‖ ChangeTracker: CBLSocketChangeTracker[0x7feec2e63d60 ts1]: Starting...
16:29:40.005‖ SyncVerbose: CBLSocketChangeTracker[0x7feec2e63d60 ts1]: GET //192.168.1.13:6984/ts1/_changes?feed=normal&heartbeat=300000&style=all_docs
16:29:40.007‖ ChangeTracker: CBLSocketChangeTracker[0x7feec2e63d60 ts1]: Started... <https://192.168.1.13:6984/ts1/_changes?feed=normal&heartbeat=300000&style=all_docs>
16:29:40.008‖ ChangeTracker: CBLSocketChangeTracker[0x7feec2e63d60 ts1]: Event 1 on <__NSCFInputStream: 0x7feec2e652c0>