./configure --enable-ssl=openssl --enable-sasl=yes --prefix=/path/to/mongoc_ssl/ --disable-automatic-init-and-cleanup --enable-static=yes --enable-examples=yes
But when i running a simple mongoc- code and connecting mLab
mongoc_client_t *client;
mongoc_collection_t *collection; bson_error_t error; int64_t count;
mongoc_init ();
client = mongoc_client_new ("mongodb://username:p...@ds000000.mlab.com:00000/db"); collection = mongoc_client_get_collection (client, "db", "fs"); count = mongoc_collection_count (collection, MONGOC_QUERY_NONE, NULL, 0, 0, NULL, &error);
if (count < 0) { fprintf (stderr, "%s\n", error.message); } else { printf ("%" PRId64 "\n", count); }
mongoc_collection_destroy (collection); mongoc_client_destroy (client); mongoc_cleanup ();It is giving me error.
2017/02/22 17:09:48.0144: [31116]: DEBUG: cluster: Authentication failed: The "SCRAM-SHA-1" authentication mechanism requires libmongoc built with --enable-sslThe "SCRAM-SHA-1" authentication mechanism requires libmongoc built with --enable-ssl
But when i running a simple mongoc- code and connecting mLab
Hi Rao,
I’ve tested your configure command, using mongo-c driver v1.5.4 (and latest v.1.6.0) also utilising your example snippet code and it's connected successfully.
My example code was compiled using below line:
$ gcc -o connect connect.c $(pkg-config --cflags --libs libmongoc-1.0)
Which in my case has expanded to:
$ gcc -o connect connect.c -I/path/to/mongoc_ssl/include/libmongoc-1.0 -I/path/to/mongoc_ssl/include/libbson-1.0 -L/path/to/mongoc_ssl/lib -lmongoc-1.0 -lsasl2 -lssl -lcrypto -lrt -lbson-1.0
Test was done on Ubuntu 16.04, connecting to mLab free SandBox.
Could you provide the following information:
make and make install after executing configure ? mongo-c driver that wasn’t compiled with ssl option ?Regards,
Wan.


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/sFubeEFxnOE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/29324a87-9abb-4e27-9563-ee9770ead9bc%40googlegroups.com.
Hi Rao,
$ gcc -o connect connect.c -I/path/to/mongoc_ssl/include/libmongoc-1.0 -I/path/to/mongoc_ssl/include/libbson-1.0 -L/path/to/mongoc_ssl/lib -lmongoc-1.0 -lsasl2 -lssl -lcrypto -lrt -lbson-1.0
Please see the expanded flags specified above again, especially related to SSL that your Makefile is missing.
Also, i have one question, can you get the list of GridFS files using mongoc driver connecting with SandBox? I am not getting success in this while working on windows platform.
You should be able to connect to GridFS using mongoc_client_get_gridfs(). See also Example: mongoc_gridfs_t . Make sure you are able to establish connection using SSL first.
Regards,
Wan.