0

I am trying to call a REST API via HTTPS by using boost::asio::ssl in my Xcode Project. I couldn't find a way to link against OpenSSL in Xcode. Possibly I am not compiling OpenSSL properly. Can you give me hints on:

  1. How to install and link against OpenSSL (version?) in Xcode (8.3.2) on Mac OS X (10.12.3)?

  2. How to add library in my Xcode project means in source tree (openssl lib or path?) and its header search path?

jweyrich
  • 31,198
  • 5
  • 66
  • 97
Qamar
  • 1
  • 2
  • I tried to improve your question but I couldn't understand point 2. Please, can you clarify? – jweyrich Jul 03 '17 at 12:34
  • Also see [How to add openssl to an xcode project](https://stackoverflow.com/q/33341113/608639), [“Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib” with Xcode 8](https://stackoverflow.com/q/43150655/608639), [Can openssl be bundled for wget wrapper app to reference in Xcode project?](https://stackoverflow.com/q/44523746/608639), [How can I include a nib in an OS X static library?](https://stackoverflow.com/q/19583380/608639), [Is it acceptable to call openssl within an app submitted to the Mac App Store?](https://stackoverflow.com/q/6725450/608639), etc. – jww Jul 03 '17 at 19:22
  • Thanks jweyrich, for point 2 I want how I should I add openssl complied library bcz I have tried steps http://mac-dev-env.patrickbougie.com/openssl from this site and able to install, creating symbolic links successfully. But when I added crypto.a libssl.a in project and its include path the xcode showing linker error for -lcryplib error. I have used openssl1.0.2k version and openssl-1.1.0e , openssl-1.1.0f also. – Qamar Jul 04 '17 at 06:01
  • jweyrich , my error journey begins here when I added boos header #include and namespace ssl = boost::asio::ssl; boost/asio/ssl/detail/openssl_types.hpp:19:10: 'openssl/conf.h' file not found – Qamar Jul 04 '17 at 06:32

1 Answers1

0

How install openssl library on Mac OS 10.12 and link in Xcdoe 8.3.2 for boost https connection ...steps are 1.Download openssl-1.0.2k from curl --remote-name https://www.openssl.org/source/openssl-1.0.2k.tar.gz into /usr/local/src folder ,please create src if not there. 2.Extract the archive and move into the folder. tar -xzvf penssl-1.0.2k.tar.gz cd penssl-1.0.2k 3.On terminal go sudo ./Configure darwin64-x86_64-cc 4.sudo make 5.sudo make test 6.sudo make install 7.export PATH="/usr/local/ssl/bin:$PATH" 8./usr/local/ssl/bin/openssl version You will get OpenSSL 1.0.2k 26 Jan 2017 Now add /usr/local/ssl/lib in your xcode project setting Library Search Path and /usr/local/ssl/include in Header search path . And finally add libssl.a and libcrypto.a in to xcode project from /usr/local/ssl/lib folder. Thats it. Thanks & Regards Qamar

Qamar
  • 1
  • 2