Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURLOPT_SSH_KNOWNHOSTS not accepted with libssh #3493

Closed
felixhaedicke opened this issue Jan 23, 2019 · 0 comments
Closed

CURLOPT_SSH_KNOWNHOSTS not accepted with libssh #3493

felixhaedicke opened this issue Jan 23, 2019 · 0 comments

Comments

@felixhaedicke
Copy link
Contributor

When curl is compiled with libssh (not libssh2), calling curl_easy_setopt() with option CURLOPT_SSH_KNOWNHOSTS fails with error code CURLE_UNKNOWN_OPTION.

Although in lib/ssh-libssh.c, I found this:

  if(data->set.str[STRING_SSH_KNOWNHOSTS]) {
    infof(data, "Known hosts: %s\n", data->set.str[STRING_SSH_KNOWNHOSTS]);
    ssh_options_set(ssh->ssh_session, SSH_OPTIONS_KNOWNHOSTS,
                    data->set.str[STRING_SSH_KNOWNHOSTS]);
  }

example program

#include <assert.h>
#include <curl/curl.h>

int main()
{
  CURLcode status = curl_global_init(CURL_GLOBAL_ALL);
  assert(CURLE_OK == status);

  CURL* curl = curl_easy_init();
  assert(curl);

  status = curl_easy_setopt(curl, CURLOPT_SSH_KNOWNHOSTS, "/tmp/khfile");
  assert(CURLE_OK == status);
}

curl/libcurl version

curl 7.63.0 (x86_64-pc-linux-gnu) libcurl/7.63.0 OpenSSL/1.1.1a zlib/1.2.11 libidn2/2.0.5 libssh/0.8.6/openssl/zlib
Release-Date: 2018-12-12
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS Debug TrackMemory IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy
felixhaedicke added a commit to felixhaedicke/curl that referenced this issue Jan 23, 2019
felixhaedicke added a commit to felixhaedicke/curl that referenced this issue Jan 23, 2019
CURLOPT_SSH_KNOWNHOSTS and CURLOPT_SSH_KEYFUNCTION are supported for
libssh as well. So accepting these options only when compiling with
libssh2 is wrong here.

Fixes curl#3493
felixhaedicke added a commit to felixhaedicke/curl that referenced this issue Jan 23, 2019
… libssh

CURLOPT_SSH_KNOWNHOSTS and CURLOPT_SSH_KEYFUNCTION are supported for
libssh as well. So accepting these options only when compiling with
libssh2 is wrong here.

Fixes curl#3493
@bagder bagder closed this as completed in 3cbf731 Jan 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant