0

I have a very simple MongoDB application that connects to a MongoDB database and works fine.

I've then added the connectivity calls to a large, complex, legacy application and when I call:

mongocxx::instance (i.e. the first MongoDB library call)

I get the following response:

2018/08/16 10:20:59.0499: [16856]: ERROR: mongoc: Failed to initialize OpenSSL.

It appears that the low-level call to SSL_CTX_new within the MongoDB C library is returning a null pointer.

I'm not too sure why this is happening. I've even gone so far as recompiling and linking my simple MongoDB app against all of the libraries that the large legacy app uses (calls to ldd are now identical) but the simple app is still working fine.

This is using the following MongoDB drivers:

mongo-c-driver-1.11.0

mongo-cxx-driver-r3.3.0

Compiled and run on RHEL7 box (7.4) using OpenSSL 1.1.0.

Any suggestions?

Zanzibar
  • 1
  • 2
  • I've done some additional digging (changed the underlying MongoDB code to print out the actual error) and I get this: ```SSL routines:SSL_CTX_new:library has no ciphers:ssl/ssl_lib.c:2519:``` – Zanzibar Aug 16 '18 at 12:16

1 Answers1

-1

I was just in trouble with the same error.

It solved it by changing the option of cmake. In this way, setting an option, it will work.

cmake -DENABLE_SSL=OFF ..

In the following method, OpenSSL initialization error occurs.

cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP = NO

I'd like to know how to prevent initialization errors with "ENABLE_AUTOMATIC_INIT_AND_CLEANUP".

https://github.com/mongodb/mongo-c-driver/blob/r1.10/NEWS#L935

https://github.com/mongodb/mongo-c-driver/blob/2edd3b2a91171a5da88e9282ffb6a3efbbc2bd91/src/libmongoc/CMakeLists.txt#L225

This problem was solved by make of OpenSSL.

Why 'apt-get install openssl' did not install last version of OpenSSL?

I used the following.

  • openssl-1.1.0f
  • mongo-c-driver-1.10.1
  • mongo-cxx-driver-r3.3.0