How to add OpenSSL to an Xcode project

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.


i tried today starting of 2020

install openssl with homebrew

brew install openssl

this will install openssl version 1.1d in

/usr/local/Cellar/[email protected]/1.1.1d/lib/

add both libcrypto.a and libssl.a

brew will not make a symbolic link to /usr/local/lib


  1. Download source from openssl source .
  2. Extract compressed file into directory of your choice. .
  3. Open command line and go to that directory and type something similar to ./configure darwin64-x86_64-cc .
  4. Then type make depend .
  5. Then make install .
  6. Go to your Xcode project build settings. Under Header Search Paths add /usr/local/ssl/include and library search paths /usr/local/ssl/lib (or whatever install paths you chose in the configure step) .
  7. Still in build settings go to Linking and under other linker flags put -lssl -lcrypto

You should be good to go now.