Basic usage of Public REST API (sync gateway)

Ok, so when enable logging I see a lot of information in the debugger window. Seems like these lines are indicative of the problem:

2017-06-01 11:05:43.507597-0500 myLocTrack[27464:14383265] WARNING: CouchbaseLite: SSL server <xxx.xxx.xxx.xxx> not trusted; cert chain follows: {at CBLWarnUntrustedCert:294}

2017-06-01 11:05:43.507995-0500 myLocTrack[27464:14383265] WARNING: David {at CBLWarnUntrustedCert:299}

Back to my original question, after installing the SSL on the sync gateway and switching the gateway string, there still must be something else I must have to do on the app side. I’m using Swift 3 in Xcode 8.3.2.

David

Edit: After re-reading the SSL blog, I’m thinking this problem has something to do with the created certificate. Here’s a snippet from the blog:

Creating your own self-signed certificate

Unlike a CA-signed cert, a self-signed cert isn’t intrinsically trustworthy: a client can’t tell who you are by examining the cert, because no recognized authority has vouched for it. But a self-signed cert is still unique (only you, as the holder of the private key, can operate a server using that cert), and it still allows the connection to be encrypted.

It’s easy to create a self-signed certificate using the openssl command-line tool and these directions. In a nutshell, you just need to run these commands:

$ openssl genrsa -out privkey.pem 2048
$ openssl req -new -x509 -sha256 -key privkey.pem -out cert.pem -days 1095

The second command is interactive and will ask you for information like country and city name that goes into the X.509 certificate. You can put whatever you want there; the only important part is the field Common Name (e.g. server FQDN or YOUR name) which needs to be the exact hostname that clients will reach your server at. The client will verify that this name matches the hostname in the URL it’s trying to access, and will reject the connection if it doesn’t.

In the last instruction, I used my name in the Common Name field, as I don’t have a URL and only am using an IP address. Might this be the problem?