I am able to compile BoringSSL on Ubuntu and created libssl.a and libcrypto.a. In Makefile I have changed -L
path to point to those library location and -lssl -lcrypto
to specify the library name. However my machine already has OpenSSL installed, so looks like in this case it is the OpenSSL libs getting picked up as always because the libraries have exact same name.
If there any other way to enforce OS to use BoringSSL other than completely remove or disable OpenSSL and try?
If you have -L
pointed to the directory where BoringSSL is built, it will always use BoringSSL instead of the system SSL (except if the linker is searching for shared libraries only, as John Bollinger points out).
You'll also need to pass -pthread
to the compiler as it can't implicitly pull in the POSIX thread library with a static library like it can with a shared library.