Closed rccvilla closed 3 years ago
Hmm, I do not really know, Mdbc just uses the C# driver and passes the connection string in there. Maybe you should ask at C# driver or MongoDB forums.
But before doing this, in a clean session, after getting this error, can you examine all errors in $Error
? And dive deeper into these errors, like what was the "Exception has been thrown by the target of an invocation" exactly?
Can you connect using your connection string and mongo shell?
Can you connect using your connection string and mongo shell?
Yeah. With mongo shell and with python
Hmm, I do not really know, Mdbc just uses the C# driver and passes the connection string in there. Maybe you should ask at C# driver or MongoDB forums.
But before doing this, in a clean session, after getting this error, can you examine all errors in
$Error
? And dive deeper into these errors, like what was the "Exception has been thrown by the target of an invocation" exactly?
$Error
Get-MdbcData: Exception has been thrown by the target of an invocation.
Nevermind, will try a different approach
I've configured mongodb to preferTLS, in my tests, and will switch to requireTLS on production, but I cannot connect to mongodb with TLS. Tried:
Connect-Mdbc -ConnectionString "mongodb://user:password@server/" $db = Get-MdbcDatabase test $collection = Get-MdbcCollection test-collection -Database $db Get-MdbcData -Collection $collection -As PS | Format-Table
Everything OK, but when I add "?tls=true" on ConnectionString... Connect-Mdbc -ConnectionString "mongodb://user:password@server/?tls=true" Then I got an exception...
Connecting to mongodb using TLS not possible?