cURL / Mailing Lists / curl-library / Single Mail


Re: CURLOPT_SSH_KEYFUNCTION never gets called?

From: Daniel Stenberg <>
Date: Mon, 21 Feb 2011 13:54:53 +0100 (CET)

On Mon, 21 Feb 2011, wrote:

> I looked through the source for libcurl and found that if the known hosts
> file name is not set (CURLOPT_SSH_KNOWNHOSTS), there is no default value and
> so the key function never gets called. Fair enough, but it seems odd that
> the other filename settings fall back to a default value if not explicitly
> set, yet the know hosts file name does not.

What would a sensible default value for a known hosts file name be? I don't
know of any, hence there is none.

It should be made more obvious in the docs though, and I've added a mention

> If I set the known hosts file name, my key function does get called
> (hooray!) but even when I return CURLKHSTAT_FINE, the authentication fails.

Well, a known hosts doesn't imply correct authentication... Can you show us
more about the exact error you get?

> Furthermore, when I return CURLKHSTAT_FINE_ADD_TO_FILE, writing to my hosts
> file fails, even though I believe the permissions are adequate (-rw-r--r--).

Again, I figure some basic single-stepping is the easiest way to figure out
what's happening...

List admin:
Received on 2011-02-21