I am trying to port an application to mac OSX. It uses openssl. I am new to xcode and mac development. Do I need to compile and install openssl myself, or is there some equi
i tried today starting of 2020
install openssl with homebrew
brew install openssl
this will install openssl version 1.1d in
/usr/local/Cellar/openssl@1.1/1.1.1d/lib/
add both libcrypto.a and libssl.a
brew will not make a symbolic link to /usr/local/lib
You will need to compile and link it yourself, and your app needs to ship it. If the license of your app and OpenSSL's license are compatible, you may use static linking. Otherwise you will need to dynamically link it.
There are a few documents describing the process and build scripts that you can find with Google searches. For iOS, there's even a Github project. I didn't copy the contents of those documents here since it's too much and it's a moving target.
You can also install OpenSSL with Homebrew. If you just want to have your app run on your Mac and you don't want to distribute it, this is the easiest way: you just need to link it. But if you want to distribute your app, you would need to copy the library/libraries to your app bundle and make sure the the linker finds it there. This also has the disadvantage that there's a possible "disconnect" between your app and the OpenSSL version: if in one year, you update OpenSSL with Homebrew and want to compile/link an older version of your app against the very same OpenSSL version as you've used at that time, you have a problem.
./configure darwin64-x86_64-cc
.make depend
.make install
./usr/local/ssl/include
and library search paths /usr/local/ssl/lib
(or whatever install paths you chose in the configure step)
.-lssl -lcrypto
You should be good to go now.