1CURLOPT_SSLKEYTYPE(3) curl_easy_setopt options CURLOPT_SSLKEYTYPE(3)
2
3
4
6 CURLOPT_SSLKEYTYPE - set type of the private key file
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSLKEYTYPE, char
12 *type);
13
15 Pass a pointer to a zero terminated string as parameter. The string
16 should be the format of your private key. Supported formats are "PEM",
17 "DER" and "ENG".
18
19 The format "ENG" enables you to load the private key from a crypto
20 engine. In this case CURLOPT_SSLKEY(3) is used as an identifier passed
21 to the engine. You have to set the crypto engine with CUR‐
22 LOPT_SSLENGINE(3). "DER" format key file currently does not work
23 because of a bug in OpenSSL.
24
25 The application does not have to keep the string around after setting
26 this option.
27
29 "PEM"
30
32 All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
33
35 CURL *curl = curl_easy_init();
36 if(curl) {
37 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
38 curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
39 curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
40 curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, "PEM");
41 curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "s3cret");
42 ret = curl_easy_perform(curl);
43 curl_easy_cleanup(curl);
44 }
45
47 If built TLS enabled.
48
50 Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if not, or
51 CURLE_OUT_OF_MEMORY if there was insufficient heap space.
52
54 CURLOPT_SSLKEY(3), CURLOPT_SSLCERT(3),
55
56
57
58libcurl 7.66.0 May 31, 2017 CURLOPT_SSLKEYTYPE(3)