-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: 1.9.2
-
Component/s: Docs
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When building with OpenSSL on macOS you may run into some non-obvious issues.
Copied from our C Driver Development guide:
Use OpenSSL on macOS:
brew install openssl
cmake -DENABLE_SSL=OPENSSL -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/lib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include .
makeYou may need to rm -rf CMakeCache.txt CMakeFiles/ in order to clear the default Darwin SSL CMake configuration from a previous build
Looking at our CMakeLists.txt file it looks like ENABLE_SSL=OPENSSL is the only necessary define. It might be worth printing out a message if the OS is macOS and ENABLE_SSL=OPENSSL is defined without OPENSSL_ROOT_DIR or OPENSSL_INCLUDE_DIR.
In my case, CMake was including OpenSSL from one directory I was trying to build against in
but it was trying to link it from another. The solution was to define OPENSSL_ROOT_DIR to the OpenSSL directory I wanted to link to.