From 93d8d3aabe004d3e37d00e5e1a9f7ae80b2fb946 Mon Sep 17 00:00:00 2001 From: tr Date: Thu, 24 May 2018 09:38:11 +0100 Subject: [PATCH] Add CURL options for certificate authentication. --- README.md | 3 +++ http.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index f9a7be8..fb821f3 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,9 @@ Select [CURL options](https://curl.haxx.se/libcurl/c/curl_easy_setopt.html) are * [CURLOPT_TLSAUTH_TYPE](https://curl.haxx.se/libcurl/c/CURLOPT_TLSAUTH_TYPE.html) * [CURLOPT_SSL_VERIFYHOST](https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html) * [CURLOPT_SSL_VERIFYPEER](https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html) +* [CURLOPT_SSLCERT](https://curl.haxx.se/libcurl/c/CURLOPT_SSLCERT.html) +* [CURLOPT_SSLKEY](https://curl.haxx.se/libcurl/c/CURLOPT_SSLKEY.html) +* [CURLOPT_SSLCERTTYPE](https://curl.haxx.se/libcurl/c/CURLOPT_SSLCERTTYPE.html) * [CURLOPT_CAINFO](https://curl.haxx.se/libcurl/c/CURLOPT_CAINFO.html) * [CURLOPT_TIMEOUT](https://curl.haxx.se/libcurl/c/CURLOPT_TIMEOUT.html) * [CURLOPT_TIMEOUT_MS](https://curl.haxx.se/libcurl/c/CURLOPT_TIMEOUT_MS.html) diff --git a/http.c b/http.c index c849245..cbc1b33 100644 --- a/http.c +++ b/http.c @@ -146,6 +146,11 @@ static http_curlopt settable_curlopts[] = { #if LIBCURL_VERSION_NUM >= 0x072500 /* 7.37.0 */ { "CURLOPT_SSL_VERIFYHOST", CURLOPT_SSL_VERIFYHOST, CURLOPT_LONG, false }, { "CURLOPT_SSL_VERIFYPEER", CURLOPT_SSL_VERIFYPEER, CURLOPT_LONG, false }, +#endif + { "CURLOPT_SSLCERT", CURLOPT_SSLCERT, CURLOPT_STRING, false }, + { "CURLOPT_SSLKEY", CURLOPT_SSLKEY, CURLOPT_STRING, false }, +#if LIBCURL_VERSION_NUM >= 0x070903 /* 7.9.3 */ + { "CURLOPT_SSLCERTTYPE", CURLOPT_SSLCERTTYPE, CURLOPT_STRING, false }, #endif #if LIBCURL_VERSION_NUM >= 0x073400 /* 7.52.0 */ { "CURLOPT_PRE_PROXY", CURLOPT_PRE_PROXY, CURLOPT_STRING, false },