[HowTo] Install cURL and OpenSSL on Android

Search This thread

r3pwn

Inactive Recognized Developer
Jul 11, 2012
1,749
2,052
r3pwn.com
NOTE: YOU MUST BE ROOTED WITH BUSYBOX INSTALLED TO INSTALL cURL AND OpenSSL.
Recently, when looking to see if it was possible to get cURL on Android, I found something posted on June 22nd of 2013 on http://curl.haxx.se/. What was it, you may ask? It was an announcement of the curl binary version 7.31.0. This also came with a nice little surprise. cURL and openssl binaries for android! If you want, you can download them by going to http://curl.haxx.se/download.html and scrolling down until you see Linux - Android. Download the ".tar.gz" file and extract it. Inside, you will see a folder called data. To install, copy the data/local/ssl to /data/local/ssl on the device. Also, push the curl and openssl binaries from data/local/bin to /system/bin on the device. Be sure to chmod them to 0755. Once all that is done, have fun using curl!

I have confirmed this to be working on my Kindle Fire HD running android 4.2.2.

EDIT: Root is needed in order to run OpenSSL, but not cURL.

Sent from my Amazon Kindle Fire HD using xda app-developers app
 
Last edited:

r3pwn

Inactive Recognized Developer
Jul 11, 2012
1,749
2,052
r3pwn.com
Screenshot!
Screenshot_2013-07-13-13-18-20.png

Sent from my Amazon Kindle Fire HD using xda app-developers app
 
Last edited:
  • Like
Reactions: GoLfWRC

r3pwn

Inactive Recognized Developer
Jul 11, 2012
1,749
2,052
r3pwn.com
I'm surprised I was the first person to post about this.

Sent from my Amazon Kindle Fire HD using xda app-developers app
 
Last edited:

heytcass

Member
May 23, 2013
42
4
Just tried to install this and didn't seem to get it running.

My purpose for getting curl on Android is so I can have SL4A run a script launched by tasker, but every time I run the script I get "Fatal error: Call to undefined function curl_init() in storage/emulated/0/sl4a/scripts/nest.class.php (a PHP script for controlling my Nest thermostat).

I followed all your steps to install, although I seemed to have to do most through Root Explorer, by pushing to a folder through adb, copying from there into /data/local/ssl (which I had to mkdir for) and /system/bin, then using Root Explorer to change the permissions. Could this install process be the issue? If not, any other tips on getting cURL installed so it can be used?

Thanks.
 

heytcass

Member
May 23, 2013
42
4
Just tried to install this and didn't seem to get it running.

My purpose for getting curl on Android is so I can have SL4A run a script launched by tasker, but every time I run the script I get "Fatal error: Call to undefined function curl_init() in storage/emulated/0/sl4a/scripts/nest.class.php (a PHP script for controlling my Nest thermostat).

I followed all your steps to install, although I seemed to have to do most through Root Explorer, by pushing to a folder through adb, copying from there into /data/local/ssl (which I had to mkdir for) and /system/bin, then using Root Explorer to change the permissions. Could this install process be the issue? If not, any other tips on getting cURL installed so it can be used?

Thanks.

I just installed adbd insecure. Should that help with the install?
 

heytcass

Member
May 23, 2013
42
4
I just installed adbd insecure. Should that help with the install?

Alright, so I followed the steps to a T on a freshly formatted phone, and I am still getting the "Call to undefined function curl_init()" Fatal error within sl4a's terminal. In my searching to get this problem resolved by my Nexus 5 getting here, I found this page: http://thesoftwarerogue.blogspot.com/2010/05/porting-of-libcurl-to-android-os-using.html.

It's a bit dated, but it seems like it should work. Is there a better chance that method will work better than this one?
 

heytcass

Member
May 23, 2013
42
4
Have you tried running it from Android Terminal Emulator or via an adb shell? That is how it's intended to run.


Sent from my iPod touch using Tapatalk

I was of the understanding that the terminal within SL4A was a proper terminal emulator. I'll try it with a standalone emulator and see what result that gets me.

Thanks.
 

heytcass

Member
May 23, 2013
42
4
I reinstalled everything again, and did the dropbox curl test, which worked no problem. But when I run the script through SL4A, I still get the curl_init fatal error. And when I try to run it through either adb shell or terminal emulator, I get a permission denied error. I seem to be doomed in getting this thing going.
 

ogah

New member
May 26, 2014
2
0
Jakarta
www.ddlgen.net
Just tried to install this and didn't seem to get it running.

My purpose for getting curl on Android is so I can have SL4A run a script launched by tasker, but every time I run the script I get "Fatal error: Call to undefined function curl_init() in storage/emulated/0/sl4a/scripts/nest.class.php (a PHP script for controlling my Nest thermostat).

I followed all your steps to install, although I seemed to have to do most through Root Explorer, by pushing to a folder through adb, copying from there into /data/local/ssl (which I had to mkdir for) and /system/bin, then using Root Explorer to change the permissions. Could this install process be the issue? If not, any other tips on getting cURL installed so it can be used?

Thanks.

seem like your php not have curl extension.
use this method
PHP:
$html = shell_exec('/system/bin/curl --url your_target_URL');
echo $html;
for other parameters please follow the curl --help
 

wavrunrx

Senior Member
Jul 14, 2011
955
398
will the cURL / openssl binaries survive ROM updates ? ie, cyanogenmod nightly --> cyanogenmod nightly ?
 

jose_ramirez

New member
Aug 5, 2014
4
1
Hi! I managed to install curl, and put the /data/local/ssl folder
in /data/local/ssl in my phone, but when I tried to do
curl to an https site, the following error appears:

Screenshot_2014-08-05-11-05-02.png

So, I'm trying to guess what's going wrong. Any hint that can
help me get rid of this error will be appreciated.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    NOTE: YOU MUST BE ROOTED WITH BUSYBOX INSTALLED TO INSTALL cURL AND OpenSSL.
    Recently, when looking to see if it was possible to get cURL on Android, I found something posted on June 22nd of 2013 on http://curl.haxx.se/. What was it, you may ask? It was an announcement of the curl binary version 7.31.0. This also came with a nice little surprise. cURL and openssl binaries for android! If you want, you can download them by going to http://curl.haxx.se/download.html and scrolling down until you see Linux - Android. Download the ".tar.gz" file and extract it. Inside, you will see a folder called data. To install, copy the data/local/ssl to /data/local/ssl on the device. Also, push the curl and openssl binaries from data/local/bin to /system/bin on the device. Be sure to chmod them to 0755. Once all that is done, have fun using curl!

    I have confirmed this to be working on my Kindle Fire HD running android 4.2.2.

    EDIT: Root is needed in order to run OpenSSL, but not cURL.

    Sent from my Amazon Kindle Fire HD using xda app-developers app
    2
    there is an easy way to install curl on android;

    - install busybox module from magisk,
    - install ccbins (cross compiled binaries) module from magisk,
    - open/run terminal emulator (e.g. termux),
    - get superuser access with "su" command,
    - run "ccbins",
    - install "curl"

    very simple and without any file download and transfer
    1
    Screenshot!
    Screenshot_2013-07-13-13-18-20.png

    Sent from my Amazon Kindle Fire HD using xda app-developers app
    1
    Do what it says,
    Run "curl -k yoururlhere"

    just like that? and avoid the verification completely?
    1
    Be sure to chmod them to 0755

    Can someone explain this bit please? :)