Buy commercial curl support from WolfSSL. We help you work
out your issues, debug your libcurl applications, use the API, port to new
platforms, add new features and more. With a team lead by the curl founder
himself.
How to use own openssl header in libcurl on macOS
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Jerry OELoo via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 1 Apr 2022 11:30:25 +0800
I download and compile openssl 3.0.2 from source and want to link it
with libcurl on macOS, however, I encounter some issues, I use latest
libcurl 7.82.0.
below is configure.
./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
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+)
But when make, it will output error:
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
Test: I found my macOS installed openssl at /usr/local/include/openssl
which is 1.1.1m, After I remove this folder, The error is fixed. So I
think the system installed openssl header is affected in libcurl make.
I think I have configured libcurl to use
/Users/test/Downloads/openssl-openssl-3.0.2/openssl/include, but it
does not work.
How can I fix this?
Date: Fri, 1 Apr 2022 11:30:25 +0800
I download and compile openssl 3.0.2 from source and want to link it
with libcurl on macOS, however, I encounter some issues, I use latest
libcurl 7.82.0.
below is configure.
./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
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+)
But when make, it will output error:
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
Test: I found my macOS installed openssl at /usr/local/include/openssl
which is 1.1.1m, After I remove this folder, The error is fixed. So I
think the system installed openssl header is affected in libcurl make.
I think I have configured libcurl to use
/Users/test/Downloads/openssl-openssl-3.0.2/openssl/include, but it
does not work.
How can I fix this?
-- Rejoice,I Desire! -- Unsubscribe: https://lists.haxx.se/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2022-04-01