# How to build OpenSSL (libcrypto) and include it in a Xojo built app

**URL:** <https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685>\
**Category:** macOS\
**Created:** [April 12, 2021, 9:04pm UTC](https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685 "2021-04-12T21:04:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jürg\_Otter](https://forum.xojo.com/user_avatar/forum.xojo.com/j%C3%BCrg_otter/32/584_2.png) [@Jürg\_Otter](https://forum.xojo.com/u/J%C3%BCrg_Otter)\
**Post date:** [April 12, 2021, 9:04pm UTC](https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685/1 "2021-04-12T21:04:02Z")

</div>

There is another Thread about Xojo users having [issues with libcrypto](https://forum.xojo.com/t/app-store-rejection-for-using-libcrypto-dylib/).  
It boils down to the fact that Apple wants Developers to include their own build/version of libcrypto. And/or on the newst macOS _(especially arm64 | when using the newst macOS SDK, such as Xojo 2021r1 does)_ to link against a specific version. But since one can’t know which libcrypto version(s) Apple provides with it’s _(upcoming)_ OSes - better include the version you need yourself.

So the big question for many of us is… How to build OpenSSL (libcrypto) and include it in a Xojo built app?

If you’re interested - here is an example project: [macOS: OpenSSL - Bring your Own](https://www.jo-tools.ch/xojo/openssl-byo/)

This example project shows how you can build your own OpenSSL Library from Source as a Universal .dylib (arm64 and x86\_64), include it in a Xojo project - and finally use it in your application. It includes

- HowTo.txt - which explains all the steps
- Build.sh - A Shell Script you can use as a template to build the current versions of the OpenSSL Library yourself
- Example Xojo Project - showing how to include your own built .dylib’s in your application

[macOS: OpenSSL - Bring your Own](https://www.jo-tools.ch/xojo/openssl-byo/)

 ![](https://forum.xojo.com/uploads/default/original/2X/6/6f7806a81c984d9045d512565c2363230c98e3ca.png)

And just for fun… I have compiled the outdated OpenSSL 0.9.8zh as Universal (arm64 and x86\_64). That’s a bit more tricky since you have to add/modify the Configuration for arm64 yourself. Notes are also in the example project. Not that I recommend that - but in case you are using Declares that only work with that libcrypto-version, and no longer with 1.1.1 - this might be a temporary solution to make your app working for a M1 Mac (as an arm64 build) without fiddling with existing Declares.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [April 12, 2021, 9:57pm UTC](https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685/2 "2021-04-12T21:57:50Z")

</div>

MBS Plugin has OpenSSL included.  
If you let me know, we could add a few more methods for you…

---

<div class="post-metadata">

**Author:** ![brian\_franco](https://forum.xojo.com/user_avatar/forum.xojo.com/brian_franco/32/156_2.png) [@brian\_franco](https://forum.xojo.com/u/brian_franco)\
**Post date:** [April 12, 2021, 10:06pm UTC](https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685/3 "2021-04-12T22:06:24Z")

</div>

For Windows OS also?

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [April 13, 2021, 1:18am UTC](https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685/4 "2021-04-13T01:18:08Z")

</div>

You can get OpenSSL built for Windows from the CURL project: [curl for Windows](https://curl.se/windows/)

---

<div class="post-metadata">

**Author:** ![Jürg\_Otter](https://forum.xojo.com/user_avatar/forum.xojo.com/j%C3%BCrg_otter/32/584_2.png) [@Jürg\_Otter](https://forum.xojo.com/u/J%C3%BCrg_Otter)\
**Post date:** [April 13, 2021, 6:07am UTC](https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685/5 "2021-04-13T06:07:03Z")

</div>

> [@Christian\_Schmitz](#):
>
> \_\_\_ Plugin has OpenSSL included.

Well, of course there are Plugins available. That’s even more convenient for most.  
It’s just that this Thread and [example](https://www.jo-tools.ch/xojo/openssl-byo/) is not about that 👼

This one is for the curious, the interested and for those few in need of a “do it yourself” way.

> Linux

Building should be quite similar to macOS, without the need of creating a Universal one.  
I just haven’t done this myself yet because all our supported Distributions come with libcrypto versions we’re fine with.

> Windows

Seems a bit more tricky to compile yourself.  
If anyone has done so and would like to contribute, I’d be happy to add your Notes about “how to … for Windows”.

Meanwhile…:

> [@Tim\_Parnell](#):
>
> You can get OpenSSL built for Windows from the CURL project: [curl for Windows](https://curl.se/windows/)

Another source to get built libraries for Windows: [Internet Component Suite](http://wiki.overbyte.eu/wiki/index.php/ICS_Download)

---

<div class="post-metadata">

**Author:** ![Carlo\_Rubini](https://forum.xojo.com/letter_avatar_proxy/v4/letter/c/94ad74/32.png) [@Carlo\_Rubini](https://forum.xojo.com/u/Carlo_Rubini)\
**Post date:** [December 14, 2021, 10:34am UTC](https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685/6 "2021-12-14T10:34:00Z")

</div>

Hi Jürg,  
thank you for sending me the .zip version via DropBox.

---

<div class="post-metadata">

**Author:** ![Jürg\_Otter](https://forum.xojo.com/user_avatar/forum.xojo.com/j%C3%BCrg_otter/32/584_2.png) [@Jürg\_Otter](https://forum.xojo.com/u/J%C3%BCrg_Otter)\
**Post date:** [February 17, 2022, 10:31pm UTC](https://forum.xojo.com/t/how-to-build-openssl-libcrypto-and-include-it-in-a-xojo-built-app/62685/7 "2022-02-17T22:31:46Z")

</div>

For those interested in this topic:

I’ve updated the example with a build script that should work for OpenSSL 3.0.x.  
It’s now located on GitHub: [macOS: OpenSSL - byo](https://github.com/jo-tools/macos-openssl-byo)

And I have tried to build the outdated OpenSSL 0.9.8zh as a Universal Binary.  
I just don’t have a M1 Mac, so I can’t try that.  
Should someone want to try: Download the built example app from the [Releases](https://github.com/jo-tools/macos-openssl-byo/releases).  
Thanks for letting me know if that works on a M1 Mac.
