Sync Gateway can do SSL termination, here is a wiki page.
There is also a set of example files
This approach becomes harder to manage when you need to scale out Sync gateway beyond a single instance.
In this case it is usually better to terminate SSL connection at a reverse-proxy/load balancer.
There is an example of configuring nginx