1CURLOPT_SSLKEYTYPE(3)      curl_easy_setopt options      CURLOPT_SSLKEYTYPE(3)
2
3
4

NAME

6       CURLOPT_SSLKEYTYPE - type of the private key file
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSLKEYTYPE, char *type);
12

DESCRIPTION

14       Pass  a  pointer  to  a null-terminated string as parameter. The string
15       should be the format of your private key. Supported formats are  "PEM",
16       "DER" and "ENG".
17
18       The  format "ENG" enables you to load the private key from a crypto en‐
19       gine. In this case CURLOPT_SSLKEY(3) is used as an identifier passed to
20       the   engine.   You   have   to   set   the  crypto  engine  with  CUR‐
21       LOPT_SSLENGINE(3).  "DER" format key file currently does not  work  be‐
22       cause of a bug in OpenSSL.
23
24       The  application  does not have to keep the string around after setting
25       this option.
26

DEFAULT

28       "PEM"
29

PROTOCOLS

31       All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
32

EXAMPLE

34       CURL *curl = curl_easy_init();
35       if(curl) {
36         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
37         curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
38         curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
39         curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, "PEM");
40         curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "s3cret");
41         ret = curl_easy_perform(curl);
42         curl_easy_cleanup(curl);
43       }
44

AVAILABILITY

46       If built TLS enabled.
47

RETURN VALUE

49       Returns CURLE_OK if TLS is supported, CURLE_UNKNOWN_OPTION if  not,  or
50       CURLE_OUT_OF_MEMORY if there was insufficient heap space.
51

SEE ALSO

53       CURLOPT_SSLKEY(3), CURLOPT_SSLCERT(3),
54
55
56
57libcurl 7.85.0                   May 17, 2022            CURLOPT_SSLKEYTYPE(3)
Impressum