I’m trying to connect to a DocumentDB from my local machine using a SSH tunnel.
I’m using the following properties in the connection string:
- tls=true
- tlsCAFile=
- tlsAllowInvalidHostnames=true
These work with mongosh and MongoDB Compass, but not with the C# driver.
With the C# driver, I get System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch, RemoteCertificateChainErrors
in the SslStream
.
Is there a way around this?