cURL / Mailing Lists / curl-library / Single Mail


Re: CURLOPT_SSH_KEYFUNCTION never gets called?

From: Daniel Stenberg <>
Date: Mon, 21 Feb 2011 00:33:40 +0100 (CET)

On Sun, 20 Feb 2011, wrote:

> I am trying to get SFTP support working using libcurl. I am setting a
> keyFunction like this:
> curlcode = curl_easy_setopt(curl, CURLOPT_SSH_KEYFUNCTION, _keyFunction);
> but my key function never gets called when I try to connect to an SFTP
> server. I'm kind of surprised by this. Is this common? Under what
> circumstances should it get called? The docs seem to say that it should
> always be called.

It always gets called if set! It only ever not gets called if your libcurl was
built with an old libssh2 present that doesn't have the required knownhost

(see lib/ssh.c line 661)

So, if you really don't get it called I think you should set a break-point in
the libcurl code and figure out how you manage to avoid it, and then tell us!

List admin:
Received on 2011-02-21