Build OpenSSL CURL for android and iOS

Viewed 741

I'm writing a native C++ library for Android and iOS. This library will be used for answering web requests. For that i used a library can be found at "https://github.com/OlehKulykov/libnhr". There is a lots of problems and i will completed that problems and now it works fine. But, it wont support HTTPS(SSL) connections. I searched and i found for that i'd use OpenSSL and cURL libraries. For that, I used steps at "https://github.com/leenjewel/openssl_for_ios_and_android" for compile OpenSSL and cURL cross platform. Build is successfull at linux and MacOS. But, when i include manifested static files(libSSL.a, libCrypto.a, libcURL.a) into my c++ library, I can see lots of OpenSSL library methods except SSL methods. I cant succeed at this point. When i used available files at github, it gives me same result. I can use OpenSSL's crypto MD5 methods but when i try to use SSL methods, it gives me errors. This is an example method and its errors.

#include "WSocketTest.h"
#include <openssl/ssl.h>
#include <openssl/md5.h>
#include <curl/curl.h>
JNIEXPORT jstring JNICALL WSocket(JNIEnv *env, jobject obj) {
   CURL * curl =curl_easy_init();
   return NULL;
}

libssl.a(ssl_lib.o):ssl_lib.c:function ssl_undefined_function: error: undefined reference to 'ERR_put_error'

libssl.a(ssl_lib.o):ssl_lib.c:function tlsa_free: error: undefined reference to 'CRYPTO_free'

libssl.a(ssl_lib.o):ssl_lib.c:function tlsa_free: error: undefined reference to 'EVP_PKEY_free'

libssl.a(ssl_lib.o):ssl_lib.c:function tlsa_free: error: undefined reference to 'CRYPTO_free'

libssl.a(ssl_lib.o):ssl_lib.c:function ct_strict: error: undefined reference to 'OPENSSL_sk_num'

libssl.a(ssl_lib.o):ssl_lib.c:function ct_strict: error: undefined reference to 'OPENSSL_sk_value'

libssl.a(ssl_lib.o):ssl_lib.c:function ct_strict: error: undefined reference to 'SCT_get_validation_status'

libssl.a(ssl_lib.o):ssl_lib.c:function ct_strict: error: undefined reference to 'ERR_put_error'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_ssl_version: error: undefined reference to 'OPENSSL_sk_num'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_ssl_version: error: undefined reference to 'ERR_put_error'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_up_ref: error: undefined reference to 'CRYPTO_atomic_add'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_session_id_context: error: undefined reference to 'ERR_put_error'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_generate_session_id: error: undefined reference to 'CRYPTO_THREAD_write_lock'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_generate_session_id: error: undefined reference to 'CRYPTO_THREAD_unlock'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_generate_session_id: error: undefined reference to 'CRYPTO_THREAD_write_lock'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_generate_session_id: error: undefined reference to 'CRYPTO_THREAD_unlock'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_has_matching_session_id: error: undefined reference to 'CRYPTO_THREAD_read_lock'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_has_matching_session_id: error: undefined reference to 'OPENSSL_LH_retrieve'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_has_matching_session_id: error: undefined reference to 'CRYPTO_THREAD_unlock'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_purpose: error: undefined reference to 'X509_VERIFY_PARAM_set_purpose'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_purpose: error: undefined reference to 'X509_VERIFY_PARAM_set_purpose'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_trust: error: undefined reference to 'X509_VERIFY_PARAM_set_trust'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_trust: error: undefined reference to 'X509_VERIFY_PARAM_set_trust'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set1_host: error: undefined reference to 'X509_VERIFY_PARAM_set1_host'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_add1_host: error: undefined reference to 'X509_VERIFY_PARAM_add1_host'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_hostflags: error: undefined reference to 'X509_VERIFY_PARAM_set_hostflags'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get0_peername: error: undefined reference to 'X509_VERIFY_PARAM_get0_peername'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_enable: error: undefined reference to 'CRYPTO_zalloc'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_enable: error: undefined reference to 'CRYPTO_zalloc'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_enable: error: undefined reference to 'OBJ_nid2sn'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_enable: error: undefined reference to 'EVP_get_digestbyname'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_enable: error: undefined reference to 'OBJ_nid2sn'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_enable: error: undefined reference to 'EVP_get_digestbyname'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_enable: error: undefined reference to 'CRYPTO_free'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_enable: error: undefined reference to 'CRYPTO_free'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get0_dane_authority: error: undefined reference to 'OPENSSL_sk_num'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get0_dane_tlsa: error: undefined reference to 'OPENSSL_sk_num'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'CRYPTO_zalloc'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'CRYPTO_malloc'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'd2i_PUBKEY'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'OPENSSL_sk_value'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'OPENSSL_sk_insert'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'EVP_MD_size'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'd2i_X509'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'X509_get0_pubkey'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'OPENSSL_sk_push'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'X509_free'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'EVP_PKEY_free'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'EVP_PKEY_free'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'EVP_PKEY_free'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'X509_free'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_dane_tlsa_add: error: undefined reference to 'OPENSSL_sk_new_null'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_mtype_set: error: undefined reference to 'CRYPTO_realloc'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_dane_mtype_set: error: undefined reference to 'CRYPTO_realloc'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set1_param: error: undefined reference to 'X509_VERIFY_PARAM_set1'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set1_param: error: undefined reference to 'X509_VERIFY_PARAM_set1'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set0_rbio: error: undefined reference to 'BIO_free_all'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set0_wbio: error: undefined reference to 'BIO_pop'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set0_wbio: error: undefined reference to 'BIO_free_all'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set0_wbio: error: undefined reference to 'BIO_push'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_wbio: error: undefined reference to 'BIO_next'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_bio: error: undefined reference to 'BIO_up_ref'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_rfd: error: undefined reference to 'BIO_find_type'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_rfd: error: undefined reference to 'BIO_ctrl'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_wfd: error: undefined reference to 'BIO_find_type'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_wfd: error: undefined reference to 'BIO_ctrl'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_fd: error: undefined reference to 'BIO_s_socket'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_fd: error: undefined reference to 'BIO_new'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_fd: error: undefined reference to 'BIO_int_ctrl'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_wfd: error: undefined reference to 'BIO_method_type'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_wfd: error: undefined reference to 'BIO_s_socket'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_wfd: error: undefined reference to 'BIO_new'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_wfd: error: undefined reference to 'BIO_int_ctrl'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_wfd: error: undefined reference to 'BIO_ctrl'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_wfd: error: undefined reference to 'BIO_up_ref'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_rfd: error: undefined reference to 'BIO_method_type'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_rfd: error: undefined reference to 'BIO_s_socket'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_rfd: error: undefined reference to 'BIO_new'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_rfd: error: undefined reference to 'BIO_int_ctrl'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_rfd: error: undefined reference to 'BIO_ctrl'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_rfd: error: undefined reference to 'BIO_up_ref'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_verify_depth: error: undefined reference to 'X509_VERIFY_PARAM_get_depth'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_get_verify_depth: error: undefined reference to 'X509_VERIFY_PARAM_get_depth'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_set_verify_depth: error: undefined reference to 'X509_VERIFY_PARAM_set_depth'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_peer_certificate: error: undefined reference to 'X509_up_ref'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_copy_session_id: error: undefined reference to 'CRYPTO_atomic_add'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_check_private_key: error: undefined reference to 'X509_check_private_key'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_check_private_key: error: undefined reference to 'X509_check_private_key'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_all_async_fds: error: undefined reference to 'ASYNC_WAIT_CTX_get_all_fds'

libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_changed_async_fds: error: undefined reference to 'ASYNC_WAIT_CTX_get_changed_fds'

0 Answers
Related