https://github.com/tls-inspector/curl-ios
Curl framework for iOS/iPad OS apps
https://github.com/tls-inspector/curl-ios
curl ios libcurl libcurl-ios library objective-c swift
Last synced: 2 months ago
JSON representation
Curl framework for iOS/iPad OS apps
- Host: GitHub
- URL: https://github.com/tls-inspector/curl-ios
- Owner: tls-inspector
- License: mit
- Created: 2017-07-08T17:56:36.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2025-04-02T18:43:17.000Z (3 months ago)
- Last Synced: 2025-04-12T02:03:52.823Z (2 months ago)
- Topics: curl, ios, libcurl, libcurl-ios, library, objective-c, swift
- Language: Shell
- Homepage:
- Size: 85.9 KB
- Stars: 16
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# curl-ios
Pre-compiled libcurl framework for iOS and iPadOS applications! Automatically updated within 24-hours of a new release of curl.
This copy of curl is built to use [OpenSSL](https://github.com/tls-inspector/openssl-ios).
## Using the pre-compiled framework
1. Download and extract curl.xcframework.zip or curl_swift.xcframework.zip from the latest release.
1. Compare the SHA-256 checksum of the downloaded framework with the fingerprint in the release
```bash
shasum -a 256 curl.xcframework.zip
```
1. _Optionally_ download the signing key from this repo and the curl.xcframework.zip.sig from the release and verify the signature
```bash
openssl dgst -sha256 -verify signingkey.pem -signature curl.xcframework.zip.sig curl.xcframework.zip
```
1. Select your target in Xcode and click the "+" under Frameworks, Libraries, and Embedded Content

1. Click "Add Other" then "Add Files..."

1. Select the extracted curl.xcframework directory## Compile it yourself
Use the included build script to compile a specific version or customize the configuration options
```
./build-ios.sh [optional configure parameters]
```To enable signature verification of downloaded artifacts set the `VERIFY` environment variable to `1`.
If you are building for use with a Swift package, you need to set the `WITH_MODULE_MAP` environment variable to `1`.
The following curl build parameters are always specified: `--disable-shared`, `--enable-static`, `--with-openssl`, and `--without-libpsl`
## Using Curl in Swift
This package provides support for using Curl in swift. When compiling this package you must define the `WITH_MODULE_MAP` environment variable with a value of `1`. This will create a .xcframework file that includes a modulemap.
### Swift Shim
This library includes a shim header to work-around some incompatibilities with curl and Swift's C interoperability. Curl
uses C macro functions that accept variables of any type and Swift does not support this.When using `curl_easy_setopt` in Swift, you will need to use one of the provided shim functions specific to the
datatype, such as `curl_easy_setopt_string`.