From ee1fbffa1c42f7ac3fc897e73e90c525037dd915 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 16 Jul 2020 17:40:14 +0200 Subject: support context-wide client authentication --- src/include/gnunet_curl_lib.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/include') diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index 875cfa3bd..0bb337ee7 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h @@ -244,6 +244,42 @@ GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, void *jcc_cls); +/** + * Force use of the provided username and password + * for client authentication for all operations performed + * with @a ctx. + * + * @param ctx context to set authentication data for + * @param userpass string with "$USERNAME:$PASSWORD" + */ +void +GNUNET_CURL_set_userpass (struct GNUNET_CURL_Context *ctx, + const char *userpass); + + +/** + * Force use of the provided TLS client certificate + * for client authentication for all operations performed + * with @a ctx. + * + * Note that if the provided information is incorrect, + * the earliest operation that could fail is + * #GNUNET_CURL_job_add() or #GNUNET_CURL_job_add2()! + * + * @param ctx context to set authentication data for + * @param certtype type of the certificate + * @param certfile file with the certificate + * @param keyfile file with the private key + * @param keypass passphrase to decrypt @a keyfile (or NULL) + */ +void +GNUNET_CURL_set_tlscert (struct GNUNET_CURL_Context *ctx, + const char *certtype, + const char *certfile, + const char *keyfile, + const char *keypass); + + /** * Schedule a CURL request to be executed and call the given @a jcc * upon its completion. Note that the context will make use of the -- cgit v1.2.3