Sync Gateway with self-signed certificate


#1

iOS SDK (1.1) fails to pull changes from sync gateway. push replication works.

I have added the certificate to CBLReplication anchor certificates. Also I have added the certificate to the OS X keychain.

I create a new CBLReplication and push changes.
Then I create a new CBLReplication to pull changes. Push succeeds but pull fails due to a SSL certificate error.

The following output is from the simulator.

14:49:28.487‖ SyncVerbose: CBL_Pusher[https://testhost.com/gateway/journaled]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
14:49:28.488‖ SyncVerbose: CBL_Pusher[https://testhost.com/gateway/journaled]: GET _local/d87d8e3da1de568ff57a9e5dfa9cacfd8ca7f4eb
14:49:28.488‖ SyncVerbose: CBL_Pusher[https://testhost.com/gateway/journaled]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
14:49:28.505‖ SyncVerbose: CBL_Pusher[https://testhost.com/gateway/journaled]: Received 1 revs
14:49:28.505‖ SyncVerbose: *** CBL_Pusher[https://testhost.com/gateway/journaled]: BEGIN processInbox (1 sequences)
14:49:28.505‖ SyncVerbose: CBL_Pusher[https://testhost.com/gateway/journaled]: POST _revs_diff
14:49:28.505‖ SyncVerbose: *** CBL_Pusher[https://testhost.com/gateway/journaled]: END processInbox (lastSequence=(null))
14:49:28.521‖ SyncVerbose: CBL_Pusher[https://testhost.com/gateway/journaled]: Setting lastSequence to 1 (from (null))
14:49:28.521‖ SyncVerbose: CBL_Pusher[https://testhost.com/gateway/journaled]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
14:49:28.521‖ Replication: CBL_Pusher[https://testhost.com/gateway/journaled] took 0.034 sec; error=(null)
14:49:28.522‖ SyncVerbose: CBL_Pusher[https://testhost.com/gateway/journaled]: PUT _local/d87d8e3da1de568ff57a9e5dfa9cacfd8ca7f4eb


14:49:28.531‖ SyncVerbose: CBL_Puller[https://testhost.com/gateway/journaled]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
14:49:28.531‖ SyncVerbose: CBL_Puller[https://testhost.com/gateway/journaled]: GET _local/f0ff656470e92acd441795970e6ee9d3803666ce
14:49:28.531‖ SyncVerbose: CBL_Puller[https://testhost.com/gateway/journaled]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
14:49:28.574‖ SyncVerbose: CBL_Puller[https://testhost.com/gateway/journaled] starting ChangeTracker: mode=0, since=(null)
14:49:28.574‖ SyncVerbose: CBLSocketChangeTracker[0x7fe483a02da0 journaled]: POST //testhost.com/gateway/journaled/_changes
14:49:28.618‖ WARNING: CBL_Puller[https://testhost.com/gateway/journaled]: SSL cert is not trustworthy (result=5)
14:49:28.618‖ WARNING: CBLSocketChangeTracker[0x7fe483a02da0 journaled]: Can't connect, giving up: Error Domain=NSURLErrorDomain Code=-1202 "The operation couldn’t be completed. (NSURLErrorDomain error -1202.)"
14:49:28.619‖ SyncVerbose: CBL_Puller[https://testhost.com/gateway/journaled]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
14:49:28.619‖ Replication: CBL_Puller[https://testhost.com/gateway/journaled] took 0.088 sec; error=Error Domain=NSURLErrorDomain Code=-1202 "The operation couldn’t be completed. (NSURLErrorDomain error -1202.)"

#2

Hi, from what I found on google for the error 1202, it seems to be a date and time problem. Did you manage to fix it? Some people advice to set it automatically ON for current time zone .
Hope it helps


#3

I didn’t manage to fix it so I used a certificate from a CA instead of a self-signed one