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

NAME

6       CURLOPT_SSLCERT_BLOB - SSL client certificate from memory blob
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_setopt(CURL  *handle,  CURLOPT_SSLCERT_BLOB, struct
12       curl_blob *stblob);
13

DESCRIPTION

15       Pass a pointer to a curl_blob structure, which  contains  (pointer  and
16       size)  a  client certificate. The format must be "P12" on Secure Transā€
17       port or Schannel. The format must be "P12" or  "PEM"  on  OpenSSL.  The
18       string "P12" or "PEM" must be specified with CURLOPT_SSLCERTTYPE(3).
19
20       If  the  blob  is initialized with the flags member of struct curl_blob
21       set to CURL_BLOB_COPY, the application does not have to keep the buffer
22       around after setting this.
23
24       This  option  is  an  alternative  to  CURLOPT_SSLCERT(3) which instead
25       expects a file name as input.
26

DEFAULT

28       NULL
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         struct curl_blob stblob;
37         stblob.data = certificateData;
38         stblob.len = filesize;
39         stblob.flags = CURL_BLOB_COPY;
40         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
41         curl_easy_setopt(curl, CURLOPT_SSLCERT_BLOB, &stblob);
42         curl_easy_setopt(curl, CURLOPT_SSLCERTTYPE, "P12");
43         curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "s3cret");
44         ret = curl_easy_perform(curl);
45         curl_easy_cleanup(curl);
46       }
47

AVAILABILITY

49       Added in libcurl 7.71.0. This  option  is  supported  by  the  OpenSSL,
50       Secure Transport and Schannel backends.
51

RETURN VALUE

53       Returns  CURLE_OK  if  TLS  enabled,  CURLE_UNKNOWN_OPTION  if  not, or
54       CURLE_OUT_OF_MEMORY if there was insufficient heap space.
55

SEE ALSO

57       CURLOPT_SSLCERTTYPE(3), CURLOPT_SSLKEY(3),
58
59
60
61libcurl 7.71.0                    24 Jun 2020          CURLOPT_SSLCERT_BLOB(3)
Impressum