Skip to content

Builds OpenSSL static libraries and packages them as XCFrameworks (ssl & crypto & apps) for iOS, watchOS, tvOS, visionOS (simulators and devices), macOS and Mac Catalyst (Intel & Apple Silicon M1).

License

Notifications You must be signed in to change notification settings

apotocki/openssl-iosx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenSSL for iOS, watchOS, tvOS, visionOS, macOS, Catalyst, Simulators - Intel(x86_64) / Apple Silicon(arm64)

Supported 3.5.X versions: 3.5.0

Supported 3.4.X versions: 3.4.1, 3.4.0

Supported 3.3.X versions: 3.3.3, 3.3.2, 3.3.1, 3.3.0

Supported 3.2.X versions: 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0

Supported 3.1.X versions: 3.1.8, 3.1.7, 3.1.6, 3.1.5, 3.1.4, 3.1.3, 3.1.2, 3.1.1, 3.1.0

Supported 3.0.X versions: 3.0.16, 3.0.15, 3.0.14, 3.0.13, 3.0.12, 3.0.11, 3.0.10, 3.0.9, 3.0.8, 3.0.8, 3.0.7

Supported 1.1.1X versions: 1.1.1w, 1.1.1v, 1.1.1u, 1.1.1t, 1.1.1s, 1.1.1q, 1.1.1p, 1.1.1o, 1.1.1n, 1.1.1m, 1.1.1l, 1.1.1k, 1.1.1j, 1.1.1i

Use the appropriate tag or branch to choose a version.

This repository provides a universal script for building static OpenSSL libraries for use in iOS, watchOS, tvOS, visionOS, and macOS & Catalyst applications. The actual library version is taken from https://github.com/openssl/openssl with an appropriate tag like 'OpenSSL_1_1_1w' or 'openssl-3.2.1'

Prerequisites

  1. Install Xcode: Ensure Xcode is installed, as xcodebuild is required to create xcframeworks.

  2. Verify Xcode Developer Directory:

    • The xcode-select -p command must point to the Xcode app's developer directory (e.g., /Applications/Xcode.app/Contents/Developer).
    • If it points to the CommandLineTools directory, reset it using one of the following commands:
      sudo xcode-select --reset
      or
      sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  3. Install Required SDKs: To build for tvOS, watchOS, visionOS, and their simulators, make sure the corresponding SDKs are installed in the folder:

   /Applications/Xcode.app/Contents/Developer/Platforms

Build Manually

    # clone the repo
    git clone https://github.com/apotocki/openssl-iosx
    
    # build libraries
    cd openssl-iosx
    scripts/build.sh

    # have fun, the result artifacts will be located in 'frameworks' folder.

Selecting Platforms and Architectures

build.sh without arguments builds xcframeworks for iOS, macOS, Catalyst and also for watchOS, tvOS, visionOS if their SDKs are installed on the system. It also builds xcframeworks for their simulators with the architecture (arm64 or x86_64) depending on the current host. If you are interested in a specific set of platforms and architectures, you can specify them explicitly using the -p argument, for example:

scripts/build.sh -p=ios,iossim-x86_64
# builts xcframeworks only for iOS and iOS Simulator with x86_64 architecture

Here is a list of all possible values for '-p' option:

macosx,macosx-arm64,macosx-x86_64,macosx-both,ios,iossim,iossim-arm64,iossim-x86_64,iossim-both,catalyst,catalyst-arm64,catalyst-x86_64,catalyst-both,xros,xrossim,xrossim-arm64,xrossim-x86_64,xrossim-both,tvos,tvossim,tvossim-arm64,tvossim-x86_64,tvossim-both,watchos,watchossim,watchossim-arm64,watchossim-x86_64,watchossim-both

Suffix '-both' means that xcframeworks will be built for both arm64 and x86_64 architectures. The platform names for macosx and simulators without an architecture suffix (e.g. macosx, iossim, tvossim) mean that xcframeworks are only built for the current host architecture.

Rebuild option

To rebuild the libraries without using the results of previous builds, use the --rebuild option

scripts/build.sh -p=ios,iossim-x86_64 --rebuild

Build Using Cocoapods.

Add the following lines into your project's Podfile:

    use_frameworks!
    pod 'openssl-iosx', '~> 3.5.0'
    # or optionally more precisely
    # pod 'openssl-iosx', :git => 'https://github.com/apotocki/openssl-iosx', :tag => '3.5.0.1'

install new dependency:

   pod install --verbose

As an advertisement…

Please check out my iOS application on the App Store:

PotoHEX
HEX File Viewer & Editor

This application is designed to view and edit files at the byte or character level; calculate different hashes, encode/decode, and compress/decompress desired byte regions.

You can support my open-source development by trying the App.

Feedback is welcome!

About

Builds OpenSSL static libraries and packages them as XCFrameworks (ssl & crypto & apps) for iOS, watchOS, tvOS, visionOS (simulators and devices), macOS and Mac Catalyst (Intel & Apple Silicon M1).

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 2

  •  
  •