[CXX-922] Fails to build using OpenSSL version 1.1.0 Created: 07/Jun/16  Updated: 13/Apr/18  Resolved: 08/Jun/16

Status: Closed
Project: C++ Driver
Component/s: Build, Portability
Affects Version/s: legacy-1.1.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Giulio Paci Assignee: David Golden
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When trying to build legacy-1.1.1 using openssl version 1.1.0 I obtain the following error:

g++ -o build/linux2/ssl/mongo/util/net/ssl_manager.o -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wnon-virtual-dtor -Woverloaded-virtual -fPIC -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-missing-braces -DMONGO_EXPOSE_MACROS -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE___THREAD -DBOOST_THREAD_USES_DATETIME -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_POSIX_MONOTONIC_CLOCK -DMONGO_HAVE_TIMEGM -DMONGO_HAVE_FIPS_MODE_SET -DLIBMONGOCLIENT_BUILDING -DSTATIC_LIBMONGOCLIENT -Ibuild/linux2/ssl -Isrc -Ibuild/linux2/ssl/mongo -Isrc/mongo src/mongo/util/net/ssl_manager.cpp
src/mongo/util/net/ssl_manager.cpp: In member function 'void mongo::

{anonymous}::SSLThreadInfo::lock_callback(int, int, const char*, int)':
src/mongo/util/net/ssl_manager.cpp:98:20: error: 'CRYPTO_LOCK' was not declared in this scope
if (mode & CRYPTO_LOCK) {
^
src/mongo/util/net/ssl_manager.cpp: In member function 'bool mongo::{anonymous}

::SSLManager::setSubjectName(const string&, std::_cxx11::string&)':
src/mongo/util/net/ssl_manager.cpp:631:43: error: 'BIO_s_file_internal' was not declared in this scope
BIO* in = BIO_new(BIO_s_file_internal());

Compilation succeed if I downgrade to OpenSSL version 1.0.2h.



 Comments   
Comment by David Kedves [ 13/Apr/18 ]

Hi there, sorry I know that this "legacy" branch is no longer active (EOL) but I've made a small mod so it can be compiled against OpenSSL 1.1.x:
-> https://github.com/mongodb/mongo-cxx-driver/pull/615/files

Br,
David

Comment by Giulio Paci [ 08/Jun/16 ]

You are right, it is still in beta. I did not notice that.
Sorry for the noise.

Comment by Andrew Morrow (Inactive) [ 08/Jun/16 ]

Hi giuliopaci - I don't think OpenSSL 1.1.0 has been released yet. The legacy C++ driver will obtain a fix for this when:

  • OpenSSL 1.1.0 is released as stable.
  • The upstream MongoDB server codebase is required to target an OS or packaging ecosystem that ships OpenSSL 1.1.0
  • The necessary changes to deal with building against OpenSSL 1.1.0 have been committed to the MongoDB master branch
  • Those changes have been validated and backported to the MongoDB v3.0 and v3.2 branches
  • And then those changes have in turn been validated and backported to the legacy C++ driver.

We do not, in general, support pre-release versions of system libraries.

Comment by Giulio Paci [ 08/Jun/16 ]

BTW: I just noticed that I reported the wrong OS. This issue is OS independent.

Generated at Wed Feb 07 22:00:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.