From: Ben Hutchings <benh@debian.org>
Date: Mon, 19 May 2025 22:52:39 +0200
Subject: configure: Disable use of GnuTLS API not yet accepted upstream

The gnutls_psk_allocate_{client,server}_credentials2() functions were
proposed in <https://gitlab.com/gnutls/gnutls/-/merge_requests/1939>
but have not yet been accepted.  Disable use of these functions
unconditionally, since they could be added upstream with different
semantics.

---
--- a/configure.ac
+++ b/configure.ac
@@ -77,9 +77,10 @@ AC_CHECK_LIB([gnutls], [gnutls_protocol_
 AC_CHECK_LIB([gnutls], [gnutls_get_system_config_file],
              [AC_DEFINE([HAVE_GNUTLS_GET_SYSTEM_CONFIG_FILE], [1],
                         [Define to 1 if you have the gnutls_get_system_config_file function.])])
-AC_CHECK_LIB([gnutls], [gnutls_psk_allocate_client_credentials2],
-             [AC_DEFINE([HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2], [1],
-                        [Define to 1 if you have the gnutls_psk_allocate_client_credentials2 function.])])
+dnl This has not yet been accepted into upstream GnuTLS and might change
+dnl AC_CHECK_LIB([gnutls], [gnutls_psk_allocate_client_credentials2],
+dnl              [AC_DEFINE([HAVE_GNUTLS_PSK_ALLOCATE_CREDENTIALS2], [1],
+dnl                         [Define to 1 if you have the gnutls_psk_allocate_client_credentials2 function.])])
 AC_SUBST([AM_CPPFLAGS])
 
 AC_CONFIG_FILES([Makefile src/Makefile src/tlshd/Makefile systemd/Makefile])
