<title>CURLOPT_SSH_KEYFUNCTION man page</title>
<meta name="generator" content="roffit">
<STYLE type="text/css">
-P.level0 {
+pre {
+ overflow: auto;
+ margin: 0;
+}
+
+P.level0, pre.level0 {
padding-left: 2em;
}
-P.level1 {
+P.level1, pre.level1 {
padding-left: 4em;
}
-P.level2 {
+P.level2, pre.level2 {
padding-left: 6em;
}
<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
<p class="level0">CURLOPT_SSH_KEYFUNCTION - callback for known host matching logic <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
-<p class="level0"><pre>
-<p class="level0">#include <curl/curl.h>
- <p class="level0">enum curl_khstat {
- CURLKHSTAT_FINE_ADD_TO_FILE,
- CURLKHSTAT_FINE,
- CURLKHSTAT_REJECT, /* reject the connection, return an error */
- CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right
- now so this causes a CURLE_DEFER error but
- otherwise the connection will be left intact
- etc */
- };
- <p class="level0">enum curl_khmatch {
- CURLKHMATCH_OK, /* match */
- CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
- CURLKHMATCH_MISSING, /* no matching host/key found */
- };
- <p class="level0">struct curl_khkey {
- const char *key; /* points to a zero-terminated string encoded with
- base64 if len is zero, otherwise to the "raw"
- data */
- size_t len;
- enum curl_khtype keytype;
- };
- <p class="level0">int ssh_keycallback(CURL *easy,
- const struct curl_khkey *knownkey,
- const struct curl_khkey *foundkey,
- enum curl_khmatch,
- void *clientp);
- <p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_KEYFUNCTION,
- ssh_keycallback);
- </pre>
+<p class="level0"><pre class="level0">
+#include <curl/curl.h>
+
+enum curl_khstat {
+ CURLKHSTAT_FINE_ADD_TO_FILE,
+ CURLKHSTAT_FINE,
+ CURLKHSTAT_REJECT, /* reject the connection, return an error */
+ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right
+ now so this causes a CURLE_DEFER error but
+ otherwise the connection will be left intact
+ etc */
+};
+
+enum curl_khmatch {
+ CURLKHMATCH_OK, /* match */
+ CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
+ CURLKHMATCH_MISSING, /* no matching host/key found */
+};
+
+struct curl_khkey {
+ const char *key; /* points to a zero-terminated string encoded with
+ base64 if len is zero, otherwise to the "raw"
+ data */
+ size_t len;
+ enum curl_khtype keytype;
+};
+
+int ssh_keycallback(CURL *easy,
+ const struct curl_khkey *knownkey,
+ const struct curl_khkey *foundkey,
+ enum curl_khmatch,
+ void *clientp);
+
+CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_KEYFUNCTION,
+ ssh_keycallback);
+</pre>
<a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
<p class="level0">Pass a pointer to your callback function, which should match the prototype shown above.
<p class="level0">It gets called when the known_host matching has been done, to allow the application to act and decide for libcurl how to proceed. The callback will only be called if <a Class="emphasis" href="./CURLOPT_SSH_KNOWNHOSTS.html">CURLOPT_SSH_KNOWNHOSTS</a> is also set.