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

NAME

6       CURLOPT_KEYPASSWD - passphrase to private key
7

SYNOPSIS

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

DESCRIPTION

14       Pass  a  pointer  to  a null-terminated string as parameter. It will be
15       used as the password required to  use  the  CURLOPT_SSLKEY(3)  or  CUR‐
16       LOPT_SSH_PRIVATE_KEYFILE(3)  private  key.   You  never  needed  a pass
17       phrase to load a certificate but you need one to load your private key.
18
19       The application does not have to keep the string around  after  setting
20       this option.
21

DEFAULT

23       NULL
24

PROTOCOLS

26       All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
27

EXAMPLE

29       CURL *curl = curl_easy_init();
30       if(curl) {
31         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
32         curl_easy_setopt(curl, CURLOPT_SSLCERT, "client.pem");
33         curl_easy_setopt(curl, CURLOPT_SSLKEY, "key.pem");
34         curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "superman");
35         ret = curl_easy_perform(curl);
36         curl_easy_cleanup(curl);
37       }
38

AVAILABILITY

40       This  option  was  known  as CURLOPT_SSLKEYPASSWD up to 7.16.4 and CUR‐
41       LOPT_SSLCERTPASSWD up to 7.9.2.
42

RETURN VALUE

44       Returns CURLE_OK  if  TLS  enabled,  CURLE_UNKNOWN_OPTION  if  not,  or
45       CURLE_OUT_OF_MEMORY if there was insufficient heap space.
46

SEE ALSO

48       CURLOPT_SSLKEY(3), CURLOPT_SSH_PRIVATE_KEYFILE(3),
49
50
51
52libcurl 7.85.0                   May 17, 2022             CURLOPT_KEYPASSWD(3)
Impressum