C# Driver Doesn't Parse Certificates

Hey there,

From what I can tell by reading through the source code for the Mongo C# Driver, it does not parse certificates from the connection string. You have to manually add in the certificates yourself by modifying the MongoClientSettings.SslSettings property. Is that right? Is there something I’m missing? Is there some easier way to add in certificates using the connection string?

My connection string currently looks like:

mongodb:///?authSource=%24external&authMechanism=MONGODB-X509&retryWrites=true&w=majority&ssl=true&tlsCertificateKeyFile=.pfx&tlsCertificateKeyFilePassword=&tlsInsecure=true

Thanks

Hey, you’re right, you should use MongoClientSettings for this target.

1 Like

Thanks for the quick response. I am using MongoClientSettings but was hoping to be able to provide my certificate in the connection string similar to the Mongosh driver. I guess I’ll have to create my own parsing method?

yes, at this moment there is no other way.