cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: connecting to sftp where server is not trusted yet

From: Miro Janosik <miro.janosik_at_gmail.com>
Date: Wed, 19 Oct 2016 15:03:55 +0200

> On Sun, 16 Oct 2016 21:45:12 +0200, Dan Fandrich wrote:
> On Fri, Oct 14, 2016 at 07:39:07AM +0200, Miro Janosik wrote:
> *> > From: Dan Fandrich <dan_at_coneharvesters.com
<http://dan_at_coneharvesters.com>> *

> *> > > 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.

After some project delays I got libcurl with sftp support.
Now I also know if supplied md5 key is correct (I set the
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 and returned error code is either CURLE_OK
or CURLE_PEER_FAILED_VERIFICATION)

Only thing that I am missing is - how to retrieve correct MD5 key from
curl? I see that it prints it out in the console, but how to get it into my
c++ code? Is there some 'retrieval' method? Some callback that I did not
find?

  cheers, Miro

*> >>> Dan *

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-19