Name
easy:SetOpt_SSH_HostKeyFunction -- callback to check host key (V2.0)
Synopsis
easy:SetOpt_SSH_HostKeyFunction(keycallback[, userdata])
Function
Pass a callback function. This callback gets called when the verification of the SSH host key is needed. It overrides #CURLOPT_SSH_KNOWNHOSTS.

The callback function looks like this:

 
res = keycallback(type, key[, userdata])

Here is a description of the callback parameters:

type
The key type. This is any from the #CURLKHTYPE_* series.

key
A string containing the key.

userdata
If you pass the optional userdata argument, the value you pass in userdata will be passed to your callback function as a this parameter. The userdata parameter can be of any type.

The callback MUST return one of the following return codes to tell libcurl how to act:

#CURLKHMATCH_OK
The host key is accepted, the connection should continue.
#CURLKHMATCH_MISMATCH
the host key is rejected, the connection is canceled.

Inputs
keycallback
callback function
userdata
optional: user data to pass to callback function

Show TOC