diff --git a/CMakeLists.txt b/CMakeLists.txt index 4772a6219a..7b442ac704 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -934,6 +934,8 @@ if(CURL_USE_GNUTLS) list(APPEND CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIRS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}") curl_required_libpaths("${GNUTLS_LIBRARY_DIRS}") + # In GnuTLS 3.8.0 (2023-02-10) and upper, this check always succeeds. + # Detecting actual TLS-SRP support needs poking the API at runtime. check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP) cmake_pop_check_state() endif() diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 6c1fe63b5e..f3d6abb23c 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -877,7 +877,12 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf, infof(data, "Using TLS-SRP username: %s", config->username); rc = gnutls_srp_allocate_client_credentials(>ls->srp_client_cred); - if(rc != GNUTLS_E_SUCCESS) { + if(rc == GNUTLS_E_UNIMPLEMENTED_FEATURE) { + failf(data, "GnuTLS: TLS-SRP support not built in: %s", + gnutls_strerror(rc)); + return CURLE_NOT_BUILT_IN; + } + else if(rc != GNUTLS_E_SUCCESS) { failf(data, "gnutls_srp_allocate_client_cred() failed: %s", gnutls_strerror(rc)); return CURLE_OUT_OF_MEMORY; diff --git a/m4/curl-gnutls.m4 b/m4/curl-gnutls.m4 index 0872ee52b6..e934f870dd 100644 --- a/m4/curl-gnutls.m4 +++ b/m4/curl-gnutls.m4 @@ -156,6 +156,9 @@ if test "$GNUTLS_ENABLED" = "1"; then dnl --- dnl We require GnuTLS with SRP support. + dnl + dnl In GnuTLS 3.8.0 (2023-02-10) and upper, this check always succeeds. + dnl Detecting actual TLS-SRP support needs poking the API at runtime. dnl --- AC_CHECK_LIB(gnutls, gnutls_srp_verifier, [