Integrate Curl 7.67.0 with MbedTLS 2.16.3

Has anyone tried integrating Curl 7.67.0 with MbedTLS 2.16.3 on Linux? I followed the instructions as per https://tls.mbed.org/kb/how-to/compile-curl-with-mbedtls. I am able to download and compile MbedTLS. I then configured Curl to build with mbedtls and built it. When I type the command curl -V, I get the error message curl: symbol look up error: curl: undefined symbol: curl_multi_poll.

Does anyone know how to fix this missing symbol error?

Hi @vysh
I have tried to build according to the guidelines, and I didn’t get an error.
Note that the symbol curl_multi_poll() is a curl fucntion, defined in src/multi.c and it shouldn’t be related to what TLS library is used.
However, when I try to see list the symbols in the built curl application, I see:

 U curl_multi_poll

This means that when I run the curl -V command curl_multi_poll is not called, and when you ran it, it was called.
Could you share the output of your curl configuration? ( the output after you do the ./configure command)
Regards,
Ron

Hi @roneld01 ,

Thanks for replying to my query. I am sharing the output of Curl configuration:

Host setup: x86_64-pc-linux-gnu
Install prefix: /usr/local
Compiler: gcc
CFLAGS: -Werror-implicit-function-declaration -O2 -Wno-system-headers -pthread
CPPFLAGS: -I/include
LDFLAGS: -L/lib
LIBS: -lmbedtls -lmbedx509 -lmbedcrypto

curl version: 7.67.0
SSL: enabled (mbedTLS)
SSH: no (–with-libssh2)
zlib: no (–with-zlib)
brotli: no (–with-brotli)
GSS-API: no (–with-gssapi)
TLS-SRP: no (–enable-tls-srp)
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: no (–with-{libidn2,winidn})
Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled
–libcurl option: enabled (–disable-libcurl-option)
Verbose errors: enabled (–disable-verbose)
Code coverage: disabled
SSPI: no (–enable-sspi)
ca cert bundle: /etc/ssl/certs/ca-certificates.crt
ca cert path: no
ca fallback: no
LDAP: no (–enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (–enable-ldaps)
RTSP: enabled
RTMP: no (–with-librtmp)
Metalink: no (–with-libmetalink)
PSL: no (libpsl not found)
Alt-svc: no (–enable-alt-svc)
HTTP2: disabled (–with-nghttp2)
HTTP3: disabled (–with-ngtcp2, --with-quiche)
ESNI: no (–enable-esni)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
Features: SSL IPv6 UnixSockets AsynchDNS NTLM NTLM_WB

Regards
Vysh

Hi @roneld01,

I have now built Curl with MbedTLS. I uninstalled both Curl and Mbed and installed the latest version again. Curl version 7.68.0 and MbedTLS version 2. 16.3.

This time I added the path of the include file and the lib file of the MbedTLS in the configure command and configured Curl. I then built and installed Curl and ran the command Curl -V and got the following output:
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 mbedTLS/2.16.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL UnixSockets

I then successfully pinged google.com.

The installation is now working.

Kind regards
Vysh

HI @vysh
I am happy you managed to resolve your issue.
You probably had some configuration issue in the initial try.
Regards

Thanks for pointing out the link https://curl.haxx.se/docs/install.html
I hadn’t read it in detail before.

The following note from the link helped:
If you have OpenSSL installed, but with the libraries in one place and the header files somewhere else, you have to set the LDFLAGS and CPPFLAGS environment variables prior to running configure. Something like this should work:

CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" ./configure

I linked the path of MbedTLS instead and it worked.

Regards

1 Like