For me just adding tls=true to my connection string worked. I'm hosting on render. Also it's important to note that the region of your cluster must be identical to that of your project region on your hosting provider.
tls=true