-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling libcurl with mbedTLS 2.4.0 (compiled with MBEDTLS_DEPRECATED_REMOVED) fails #1087
Comments
Thanks! |
I don't know where the minimum dependency versions for various configurations are documented (if anywhere), but it should be noted that this breaks compiling curl 7.51 against any version of mbedtls earlier than 2.4. Should this be made version-conditional? |
Add a patch so curl builds against mbedtls pre-2.4, ref curl/curl#1087
Ugh. Well I call that a stupid decision by the mbedTLS people since they could just have made the old header name work. Having it version-conditional sounds sensible, if we can figure out the mbedtls version before the included is made? |
2.4.0 was the first mbedtls release that included Mbed-TLS/mbedtls@3616f6f |
Like this? diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c
index 24249dd..9f29ff0 100644
--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -29,15 +29,19 @@
#include "curl_setup.h"
#ifdef USE_MBEDTLS
+#include <mbedtls/version.h>
+#if MBEDTLS_VERSION_NUMBER >= 0x02040000
#include <mbedtls/net_sockets.h>
+#else
+#include <mbedtls/net.h>
+#endif
#include <mbedtls/ssl.h>
#include <mbedtls/certs.h>
#include <mbedtls/x509.h>
-#include <mbedtls/version.h>
#include <mbedtls/error.h>
#include <mbedtls/entropy.h>
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/sha256.h> |
Looks about right. Will test that and report back. |
Add a patch so curl builds against mbedtls pre-2.4, ref curl/curl#1087
That's working so far, against mbedtls 2.3.0. |
Thanks! |
Add a patch so curl builds against mbedtls pre-2.4, ref curl/curl#1087
I did this
We compiled the current version of mbedTLS (2.4.0) with "
MBEDTLS_DEPRECATED_REMOVED
", and we compiled libcurl to reference that library. Compilation of libcurl fails with:vtls/mbedtls.c: In function ‘mbed_connect_step1’:
vtls/mbedtls.c:361: error: ‘mbedtls_net_send’ undeclared (first use in this function)
vtls/mbedtls.c:361: error: (Each undeclared identifier is reported only once
vtls/mbedtls.c:361: error: for each function it appears in.)
vtls/mbedtls.c:362: error: ‘mbedtls_net_recv’ undeclared (first use in this function)
make[2]: *** [vtls/libcurl_la-mbedtls.lo] Error 1
I expected the following
Successful compilation.
curl/libcurl version
7.50.3
operating system
Linux (CentOS 5)
Solution
In "lib/vtls/mbedtls.c" change the include from: "
#include <mbedtls/net.h>
" to "#include <mbedtls/net_sockets.h>
"The text was updated successfully, but these errors were encountered: