Properly verify certificates when using TLS transport