https://github.com/apotocki/openssl-iosx
Builds OpenSSL static libraries and packages them as XCFrameworks (ssl & crypto) for iOS (simulator and device), visionOS (simulator and device), macOS and Mac Catalyst (Intel & Apple Silicon M1).
https://github.com/apotocki/openssl-iosx
ios ios-simulator mac-catalyst macos openssl visionos visionos-simulator xcframework
Last synced: 12 months ago
JSON representation
Builds OpenSSL static libraries and packages them as XCFrameworks (ssl & crypto) for iOS (simulator and device), visionOS (simulator and device), macOS and Mac Catalyst (Intel & Apple Silicon M1).
- Host: GitHub
- URL: https://github.com/apotocki/openssl-iosx
- Owner: apotocki
- License: other
- Created: 2020-12-31T18:03:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-05-20T11:14:53.000Z (about 1 year ago)
- Last Synced: 2025-05-20T11:24:41.230Z (about 1 year ago)
- Topics: ios, ios-simulator, mac-catalyst, macos, openssl, visionos, visionos-simulator, xcframework
- Language: Shell
- Homepage:
- Size: 82 KB
- Stars: 22
- Watchers: 2
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## 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:
```bash
sudo xcode-select --reset
```
or
```bash
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](https://apps.apple.com/us/app/potohex/id1620963302).
Feedback is welcome!