链接openssl所以库与android make文件

时间:2012-09-07 16:52:06

标签: curl android-ndk openssl libcurl

我使用以下链接分别为android ndk构建了curl和openssl openssl https://github.com/eighthave/openssl-android

curl http://thesoftwarerogue.blogspot.in/2010/05/porting-of-libcurl-to-android-os-using.html#comment-form

我还测试了http GET的简单curl代码,可以使用libcurl.so,现在如何在curl代码中使用openssl库(libssl.so,libcrypto.so)来试用https

请提供一些有关此

的见解

1 个答案:

答案 0 :(得分:1)

您必须配置libcurl以通常启用SSL并特别使用OpenSSL。使用配置脚本准备curl_config.h。确保在那里设置了以下定义(对于Android和OpenSSL):

#define HAVE_LIBSSL 1
#define USE_OPENSSL 1
#define USE_SSLEAY 1
#define HAVE_OPENSSL_CRYPTO_H 1
#define HAVE_OPENSSL_ERR_H 1
#define HAVE_OPENSSL_PEM_H 1
#define HAVE_OPENSSL_PKCS12_H 1
#define HAVE_OPENSSL_RSA_H 1
#define HAVE_OPENSSL_SSL_H 1
#define HAVE_OPENSSL_X509_H 1

使用此定义重新编译lib curl。现在您可以访问https链接。