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

NAME

6       CURLOPT_SSLKEYTYPE - set type of the private key file
7

SYNOPSIS

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

DESCRIPTION

15       Pass a pointer to a null-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  en‐
20       gine. In this case CURLOPT_SSLKEY(3) is used as an identifier passed to
21       the  engine.  You  have  to   set   the   crypto   engine   with   CUR‐
22       LOPT_SSLENGINE(3).   "DER"  format key file currently does not work be‐
23       cause of a bug in OpenSSL.
24
25       The application does not have to keep the string around  after  setting
26       this option.
27

DEFAULT

29       "PEM"
30

PROTOCOLS

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

EXAMPLE

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

AVAILABILITY

47       If built TLS enabled.
48

RETURN VALUE

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

SEE ALSO

54       CURLOPT_SSLKEY(3), CURLOPT_SSLCERT(3),
55
56
57
58libcurl 7.76.1                 November 04, 2020         CURLOPT_SSLKEYTYPE(3)
Impressum