No usable version of libssl was found on Apple Silicon M1 Mac

Viewed 2209

Code in Azure function breaks locally on M1 Mac when AesGCM does Decrypt

This is the part of the code that breaks

using var cipher = new AesGcm(key);
cipher.Decrypt(nonce, toDecrypt, tag, decryptedData, associatedData);

I have installed openssl and set DYLD_LIBRARY_PATH in ~/.zshrc

Originally the code broke on Intel Mac as well but since I set DYLD_LIBRARY_PATH, it worked. Yet it still breaks on arm-based M1 Mac.

Configuration

  • netcoreapp3.1
  • OS Version: Mac OS Big Sur Version 11.4, (Apple M1), 16 GB
  • Architecture: arm
  • openssl version: LibreSSL 2.8.3, openssl@1.1

Can anyone help please? This seems to be the only issue that stops me from developing in .NET on M1 Mac.

1 Answers

With Kevin's help, I managed to install Intel version of openssl.

The trick was to use iTerm on Resetta 2 and install Intel version of brew and then to install Intel version of openssl

  • Copy iTerm in the Application directory and rename it to iTerm (Intel)
  • cmd + i and tick on "open using Resetta"
  • On iTerm (Intel), install brew. It will be installed in /usr/local
  • arch -x86_64 /usr/local/bin/brew openssl
  • In ~/.zshrc, set export DYLD_LIBRARY_PATH="/usr/local/opt/openssl@1.1/lib"
Related