Building OpenSSL from source

The following instructions apply to Ubuntu only. For other platforms such as Windows, macOS, refer to platform-specific instructions at Open SSL documentation. You can use the following guide to build the OpenSSL libraries on Ubuntu 20.04. An Ubuntu distribution running on WSL can also be used. Other Linux distributions may require different packages.

You can use the following guide to build the OpenSSL libraries on Ubuntu 20.04. An Ubuntu distribution running on WSL can also be used. Other Linux distributions may require different packages.

  1. Install the required packages

    Use dark colors for code blocksCopy
      
    1
    2
    sudo apt update
    sudo apt install git make perl unzip
    
  2. Get the Android NDK r21e

    Use dark colors for code blocksCopy
       
    1
    2
    3
    cd ~
    wget https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip
    unzip android-ndk-r21e-linux-x86_64.zip
    
  3. Get the OpenSSL source code

    Use dark colors for code blocksCopy
     
    1
    git clone https://github.com/openssl/openssl.git --branch OpenSSL_1_1_1j --depth 1
  4. Set up the build environment

    Use dark colors for code blocksCopy
        
    1
    2
    3
    4
    cd openssl
    export ANDROID_NDK_HOME=~/android-ndk-r21e
    export PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
    export CC=clang
  5. Configure the project for ARM64

    Use dark colors for code blocksCopy
     
    1
    perl Configure android-arm64 -D__ANDROID_API__=23
  6. Build

    Use dark colors for code blocksCopy
     
    1
    make
  7. Rename the binaries

    Use dark colors for code blocksCopy
      
    1
    2
    mv libcrypto.so.1.1 libcrypto_1_1.so
    mv libssl.so.1.1 libssl_1_1.so
    

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.