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