Update Openssl Mac



Download the latest version of OpenSSL for Mac - Cryptography library and toolkit that enables developers to work with the TLS and SSL protocols. Read 0 user reviews of OpenSSL on MacUpdate. Brew update brew install openssl echo 'export PATH='/usr/local/opt/openssl/bin:$PATH' /.bashprofile source /.bashprofile You will have the latest version of openssl installed and accessible from cli (command line/terminal). Here are the steps that you need to do to get a copy of OpenSSL ready for inclusion in your Universal 2 application for the Mac: Download OpenSSL 1.1.1g sources. Extract the archive into two different folders, one for Intel and the other for ARM instruction sets, respectively.

OpenSSL is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. For more information about the team and community around the project, or to start making your own contributions, start with the community page. To get the latest news, download the source, and so on, please see the sidebar or the buttons at the top of every page.

OpenSSL is licensed under an Apache-style license, which basically means that you are free to get and use it for commercial and non-commercial purposes subject to some simple license conditions.

For a list of vulnerabilities, and the releases in which they were found and fixes, see our Vulnerabilities page.

Latest News

DateItem
25-Mar-2021OpenSSL 1.1.1k is now available, including bug and security fixes
11-Mar-2021Alpha 13 of OpenSSL 3.0 is now available: please download and test it
18-Feb-2021Alpha 12 of OpenSSL 3.0 is now available: please download and test it
16-Feb-2021OpenSSL 1.1.1j is now available, including bug and security fixes
28-Jan-2021Alpha 11 of OpenSSL 3.0 is now available: please download and test it
More...

Legalities

Please remember that export/import and/or use of strongcryptography software, providing cryptography hooks, or even justcommunicating technical details about cryptography software isillegal in some parts of the world. So when you import thispackage to your country, re-distribute it from there or evenjust email technical suggestions or even source patches to theauthors or other people you are strongly advised to pay closeattention to any laws or regulations which apply toyou. The authors of OpenSSL are not liable for any violationsyou make here. So be careful, it is your responsibility.

Programming

How to Compile OpenSSL 1.1.1 for Apple Silicon

You have an app on the Mac App Store which depends on OpenSSL for receipt validation, among other things. This validation may be done through Receigen, Swifty Receipt Validator, or your own home-grown receipt validation logic.

But Apple recently announced another instruction set that you need to support in your mac app: ARM64. These new machines could come as early as Big Sur’s general availability, which is likely in October 2020. This means that you have about three months left to update your macOS application.

Update Openssl Mac

Unfortunately CocoaPods hasn’t offer any OpenSSL distributions for Apple Silicon macintosh computers yet. Sure there are a few pre-compiled ARM64 binaries but those links against iOS frameworks, not macOS.

Wouldn’t it be great if you have your Mac App ready for Apple Silicon on the same day Big Sur is on Golden Master?

Here are the steps that you need to do to get a copy of OpenSSL ready for inclusion in your Universal 2 application for the Mac:

  1. Download OpenSSL 1.1.1g sources.
  2. Extract the archive into two different folders, one for Intel and the other for ARM instruction sets, respectively.
  3. Configure and compile each separately.
  4. Join results of the two together to create a Universal Library.

In this article I’m going to assume that you are going to extract OpenSSL sources into sibling folders with the following names:

  • openssl-1.1.1g-x86_x64 – for the Intel build.
  • openssl-1.1.1g-arm64 – for the ARM build.

Building the Intel Half

Building the x86_64 portion would be straight-forward since this is currently supported by OpenSSL 1.1.1g. You need to extract the OpenSSL sources into a dedicated folder for the architecture, run configure and then make. Optionally set the macOS deployment target if you need your app to run on earlier versions of the operating system.

You can find an example below. Pay special attention on the arguments to the Configure script.

By the time make completes, you should get four files that comprises of the static and dynamic libraries of OpenSSL.

  • libssl.1.1.dylib
  • libcrypto.1.1.1.dylib
  • libssl.a
  • libcrypto.a

Building the ARM Half

However the arm64 portion requires changes to OpenSSL’s build configuration as the macOS build of the instruction set is not currently supported by the library.

Having extracted the OpenSSL sources (be sure extract it into a separate location than the one you’ve used to build the Intel portion), then modify file Configurations/10.main.conf to add the macOS arm64 build configuration. Add the following snippet at around line 1560, right under the entry for “darwin64-x86_64-cc”.

(Special thanks to OpenSSL PR 12254 for the above configuration snippet).

When you’re done, the file should look like the following:

Then run Configure and make similar to before. Take note that the Configure script takes a different set of arguments.

By the time make completes, you would get four files that comprises of the static and dynamic libraries of OpenSSL, having the same file names as the ones previously compiled for Intel. This is why you should create a copy for each architecture and compile it in two different folders.

Creating Universal Libraries

Having the libraries compiled for the respective Intel and ARM64 instruction sets, the last step would be combining the two halves of the each library file into their respective universal library files. Use lipo for this, as follows.

Update

When you’re done combining the library files, check them using the file tool and verify that indeed you have a universal library.

If you use OpenSSL for license validation, you should use the static library version. Which are the libcrypto.a and libssl.a files. Static linking reduces the risk of code injection via library replacement. In other words, it’ll be harder to for crackers to replace the OpenSSL libraries inside your app bundle and make your app use their compromised replacement version instead.

Nevertheless if you use OpenSSL as dynamic libraries, then you would need to change its install names be embeddable into your app bundle’s Frameworks folder. Plain compilation of OpenSSL dynamic libraries are meant to be installed in a shared folder.

Use install_name_tool on the dynamic versions of the library files as follows:

As always, it’ll be prudent to check your work. Use otool -D to print the install name of a dynamic library.

Next Steps

In case you’re in a hurry, I’ve compiled these libraries for you that you can download and drop them into your project. These were built on Xcode 12 Beta 4 running on the Apple Silicon version of Big Sur. These library files are temporary stop-gap until OpenSSL officially support Apple Silicon.

Update openssl mac

This article was tested with Xcode 12 Beta 4 running on the Apple Silicon version of Big Sur Beta 4. You don’t need an Apple Silicon mac to compile libraries or applications for the processor — Xcode 12 can produce ARM64 binaries even when running on Intel macs. However to test the ARM64 half of a Universal Binary you would need an Apple Silicon mac.

An Apple Silicon mac can run both the Intel and the ARM64 portions of a universal binary application. But not the other way around. Intel binaries are emulated under Rosetta 2 on Apple Silicon, but there is no emulation of ARM64 on Intel-based mac.

But even when you don’t have an Apple Silicon Mac (yet), merely compiling for Universal Binary would be a good start. You’ll know which pre-built 3rd party libraries to update, for which OpenSSL is likely one of several. There are likely ARM-related compiler warnings to heed out for.

Update Openssl Mac

Why wait? Get your Xcode Beta copy today and start building your Mac app for ARM64!

Until next time.

Upgrade Openssl Mac Without Brew


Leave a Reply