【问题标题】:linking openssl so libraries with android make file将openssl so库与android make文件链接
【发布时间】:2012-09-01 14:04:00
【问题描述】:

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

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

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

请提供一些关于此的见解

【问题讨论】:

    标签: curl android-ndk openssl libcurl


    【解决方案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 链接了。

    【讨论】:

      猜你喜欢
      • 2014-09-29
      • 1970-01-01
      • 1970-01-01
      • 2021-04-29
      • 2019-02-18
      • 1970-01-01
      • 2014-01-29
      • 2016-10-25
      • 1970-01-01
      相关资源
      最近更新 更多