Mongo C Driver can't find certificate file

I’m working on a project where I should connect my client-app to mongodb with cert.

My client-app uses the mongo-c-driver, after looking in the doc I found this API mongoc_client_pool_set_ssl_opts which seems to be easy to use.

The problem is whenever I pass the path to the .pem (server certificate and CA) (generated with this tutorial) the API return this error mongoc: Cannot find certificate in 'file_where_cert_is_stored.pem'.

What am I doing wrong so the API can’t find the certificate ?

The problem was that my file didn’t respect the .pem file format, since I had to “fprintf” my certificat to pass it to this API, it would be great if we can pass directly a buffer containing the certificat to this API instead of a file path.

@KamelA what frprintf invocation did you use to get this work? I would like to understand how the data differed between the instance where the failure occurred and where it succeeded.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.