【问题标题】:How to use own openssl header in libcurl on macOS如何在 macOS 上的 libcurl 中使用自己的 openssl 标头
【发布时间】:2022-11-09 22:18:02
【问题描述】:

我从源代码下载并编译 openssl 3.0.2 并希望将其与 libcurl 链接苹果系统,但是,我遇到一些问题,我使用最新的 libcurl 7.82.0。
下面是配置。

./configure --prefix="$(pwd)/curl" --with-ssl=/Users/test/Downloads/openssl-openssl-3.0.2/openssl --enable-static --disable-shared --disable -ftp --disable-file --disable-ldap --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable -gopher --disable-ares --disable-debug --with-zlib=/Users/test/Downloads/zlib-1.2.11/zlib --without-libidn --without-brotli --without-zstd --without -nghttp2 --without-librtmp --without-libidn2 --without-winidn

并且配置结果看起来不错,openssl 包含文件夹已设置。

   Host setup:       x86_64-apple-darwin20.6.0
  Install prefix:   /Users/test/Downloads/curl-7.82.0/curl
  Compiler:         gcc
   CFLAGS:          -Qunused-arguments -Wno-pointer-bool-conversion -Os -Werror=partial-availability -pthread
   CPPFLAGS:        -isystem /Users/test/Downloads/zlib-1.2.11/zlib/include -isystem /Users/test/Downloads/openssl-openssl-3.0.2/openssl/include -DOPENSSL_SUPPRESS_DEPRECATED
   LDFLAGS:         -framework CoreFoundation -framework SystemConfiguration -L/Users/test/Downloads/zlib-1.2.11/zlib/lib -L/Users/test/Downloads/openssl-openssl-3.0.2/openssl/lib
   LIBS:            -lssl -lcrypto -lssl -lcrypto -lz

  curl version:     7.82.0
  SSL:              enabled (OpenSSL v3+)

但是make的时候会输出错误:

Undefined symbols for architecture x86_64:
  "_EVP_PKEY_id", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
  "_SSL_get_peer_certificate", referenced from:
      _ossl_connect_common in libcurl.a(libcurl_la-openssl.o)
ld: symbol(s) not found for architecture x86_64

测试: 我发现 os 在 /usr/local/include/openssl 安装了 openssl1.1.1m, 删除此文件夹后,错误已修复。所以我认为系统安装的openssl头文件在libcurl make中受到影响。

我想我已经将 libcurl 配置为使用/Users/test/Downloads/openssl-openssl-3.0.2/openssl/include,但它不起作用。

提前致谢。

【问题讨论】:

    标签: libcurl


    【解决方案1】:

    我对 openSSL@3 有同样的问题。我改为使用 openssl@1.1/1.1.1s 和 libcurl 并且它正在工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-09
      • 2022-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-07
      • 1970-01-01
      相关资源
      最近更新 更多