--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -724,7 +724,7 @@ void Curl_mbedtls_session_free(void *ptr
 
 size_t Curl_mbedtls_version(char *buffer, size_t size)
 {
-  unsigned int version = mbedtls_version_get_number();
+  unsigned int version = MBEDTLS_VERSION_NUMBER;
   return snprintf(buffer, size, "mbedTLS/%d.%d.%d", version>>24,
                   (version>>16)&0xff, (version>>8)&0xff);
 }
