Topic: How to make a post request to https from native code in Android?

Hello everyone,

i have just discovered wolfSSL in my attempt to find how to make a post request to an https website from native code in an Adnroid app.

I am experimenting with an Android app where there is some function I have implemented in C. The result of this function is a string which I would like to post to an https service listening. I can do that if I pass the string through JNI to the java layer but I would like to try and do that while staying at the native layer.

Wolfssl seems really promising and with a lot of features, something that confused me on how I should proceed with my task.

Is it possible to use wolfssl to do a post request within the native layer of Android?
If yes, would it be completely portable across different architectures of android?

Any help would be highly appreciated.

Thank you

Share

Re: How to make a post request to https from native code in Android?

Hi vaslion18,

Yes, wolfSSL can be used on Android for secure SSL/TLS communication.  We typically see Android users use wolfSSL through our JNI layer, since most applications are written in Java.  But, if you are only looking to use wolfSSL at the native C level on Android, you will be able to directly call native wolfSSL API.

wolfSSL itself is only an SSL/TLS layer, and does not include any HTTP functionality.  You would need to have other logic, or libraries for HTTP, but could route those through wolfSSL for SSL/TLS.

For getting wolfSSL compiling and running on Android, you may be able to reference some of our example projects here:
https://github.com/wolfSSL/wolfssl-exam … er/android

These example projects use our JNI wrappers, but you may be able to use the examples as reference for compiling the native wolfSSL library.  I believe you will need to re-compile wolfSSL for each unique Android architecture you are using.

If you have any additional questions, feel free to ask, or email our support team directly at support@wolfssl.com.

Best Regards,
Chris