{"id":15631638,"url":"https://github.com/robertying/openssl-curl-android","last_synced_at":"2025-05-07T13:01:21.691Z","repository":{"id":40637026,"uuid":"173361361","full_name":"robertying/openssl-curl-android","owner":"robertying","description":"Compile openssl and curl for Android","archived":false,"fork":false,"pushed_at":"2022-04-20T09:53:22.000Z","size":38,"stargazers_count":214,"open_issues_count":2,"forks_count":75,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T10:11:56.025Z","etag":null,"topics":["android","curl","ndk","openssl"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertying.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-01T20:06:20.000Z","updated_at":"2025-03-29T01:33:56.000Z","dependencies_parsed_at":"2022-09-10T17:31:15.943Z","dependency_job_id":null,"html_url":"https://github.com/robertying/openssl-curl-android","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertying%2Fopenssl-curl-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertying%2Fopenssl-curl-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertying%2Fopenssl-curl-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertying%2Fopenssl-curl-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertying","download_url":"https://codeload.github.com/robertying/openssl-curl-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252883219,"owners_count":21819157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","curl","ndk","openssl"],"created_at":"2024-10-03T10:41:05.147Z","updated_at":"2025-05-07T13:01:21.612Z","avatar_url":"https://github.com/robertying.png","language":"Shell","readme":"# openssl-curl-android\n\nCompile openssl and curl for Android\n\n## Prerequisites\n\nMake sure you have `Android NDK` installed.\n\nYou may also need to install `autoconf` and `libtool` toolchains as well as build essentials.\n\n## Download\n\nIf you do not want to compile them yourself, you can download pre-compiled static libraries from [releases](https://github.com/robertying/openssl-curl-android/releases). They are in `build.tar.gz`.\n\nDoing your own compilation is recommended, since the pre-compiled binary can become outdated soon.\n\nCheckout newer versions in git submodules to compile newer versions of the libraries. For example, to build `OpenSSL_1_1_1l` and `curl-7_78_0`:\n\n```bash\ncd openssl\ngit fetch\ngit checkout OpenSSL_1_1_1l\ncd ..\n\ncd curl\ngit fetch\ngit checkout curl-7_78_0\ncd ..\n```\n\n## Usage\n\n```bash\ngit clone https://github.com/robertying/openssl-curl-android.git\ncd openssl-curl-android\ngit submodule update --init --recursive\n\nexport NDK=your_android_ndk_root_here # e.g. $HOME/Library/Android/sdk/ndk/23.0.7599858\nexport HOST_TAG=see_this_table_for_info # e.g. darwin-x86_64, see https://developer.android.com/ndk/guides/other_build_systems#overview\nexport MIN_SDK_VERSION=23 # or any version you want\n\nchmod +x ./build.sh\n./build.sh\n```\n\nAll compiled libs are located in `build/openssl` and `build/curl` directory.\n\nUse NDK to link those libs, part of `Android.mk` example:\n\n```makefile\ninclude $(CLEAR_VARS)\nLOCAL_MODULE := curl\nLOCAL_SRC_FILES := build/curl/$(TARGET_ARCH_ABI)/libcurl.a\ninclude $(PREBUILT_STATIC_LIBRARY)\n```\n\n## Options\n\n- Change scripts' configure arguments to meet your own needs.\n\n- For now, using TLS (https) in Android would throw `peer verification failed`.\n\n  Please explicitly set `curl_easy_setopt(curl, CURLOPT_CAINFO, CA_BUNDLE_PATH);` where `CA_BUNDLE_PATH` is your ca bundle path in the device storage.\n\n  You can download and copy [cacert.pem](https://curl.haxx.se/docs/caextract.html) to Android assets or the device internal storage to get TLS working for libcurl.\n\n## Working Examples\n\n- See this minimal example which calls `curl` from Android app, using `JNI` to use `libcurl`: [AndroidCurlExample](https://github.com/robertying/AndroidCurlExample). It includes `Android.mk` setup and `JNI` configurations.\n\n- Checkout this more complex [repo](https://github.com/robertying/CampusNet-Android/blob/master/app/src/main/cpp/jni) to see how to integrate other compiled static libraries into an existing Android project, including `Android.mk` setup and `JNI` configurations.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertying%2Fopenssl-curl-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertying%2Fopenssl-curl-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertying%2Fopenssl-curl-android/lists"}