1CURLOPT_SSH_KEYDATA(3) curl_easy_setopt options CURLOPT_SSH_KEYDATA(3)
2
3
4
6 CURLOPT_SSH_KEYDATA - pointer to pass to the SSH key callback
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_KEYDATA, void
12 *pointer);
13
15 Pass a void * as parameter. This pointer will be passed along verbatim
16 to the callback set with CURLOPT_SSH_KEYFUNCTION(3).
17
19 NULL
20
22 SFTP and SCP
23
25 static int keycb(CURL *easy,
26 const struct curl_khkey *knownkey,
27 const struct curl_khkey *foundkey,
28 enum curl_khmatch,
29 void *clientp)
30 {
31 /* 'clientp' points to the callback_data struct */
32 /* investigate the situation and return the correct value */
33 return CURLKHSTAT_FINE_ADD_TO_FILE;
34 }
35 {
36 curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/thisfile.txt");
37 curl_easy_setopt(curl, CURLOPT_SSH_KEYFUNCTION, keycb);
38 curl_easy_setopt(curl, CURLOPT_SSH_KEYDATA, &callback_data);
39 curl_easy_setopt(curl, CURLOPT_SSH_KNOWNHOSTS, "/home/user/known_hosts");
40
41 curl_easy_perform(curl);
42 }
43
45 Added in 7.19.6
46
48 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
49 if not.
50
52 CURLOPT_SSH_KEYDATA(3), CURLOPT_SSH_KNOWNHOSTS(3),
53
54
55
56libcurl 7.71.1 May 31, 2017 CURLOPT_SSH_KEYDATA(3)