cURL / Mailing Lists / curl-library / Single Mail


Re: connecting to sftp where server is not trusted yet

From: Dan Fandrich <>
Date: Sun, 16 Oct 2016 21:45:12 +0200

On Fri, Oct 14, 2016 at 07:39:07AM +0200, Miro Janosik wrote:
> > From: Dan Fandrich <>
> > > I'm missing some functions that would return me the server's host key so I
> > > could compare it to my local key; and then approving the server that it is ok
> > > to connect.
> >
> > curl will do this for you when you set CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
> Okay, it will do it for me, but how will I get the information if the
> server's key has changed (something like the message 'key is unknown,
> do you agree to proceed')? I mean if server's key has changed/is
> unknown then user should approve the connection, right?

libcurl will return an error code in this case. It's up to the application to
deal with that error appropriately.

>>> Dan
List admin:
Received on 2016-10-16