cURL não aceitando sftp

0

Estou tentando configurar o SFTP com cURL e segui essas instruções no blog de Andrew Berls , mas se eu executar o comando curl -V , recebo esta saída:

curl 7.57.0 (i686-pc-linux-gnu) libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Release-Date: 2017-11-29
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets

Então, por algum motivo, o sftp não está aparecendo, como posso corrigir isso?

Este é o log de erros quando executo make install seguindo as instruções acima:

Making install in lib
make[1]: Entering directory '/root/curl-7.47.0/lib'
  CC       vtls/libcurl_la-openssl.lo
vtls/openssl.c: In function 'Curl_ossl_cleanup':
vtls/openssl.c:758:3: warning: 'ERR_remove_thread_state' is deprecated [-Wdeprecated-declarations]
   ERR_remove_thread_state(NULL);
   ^
In file included from /usr/include/openssl/ui.h:13:0,
                 from /usr/include/openssl/engine.h:29,
                 from ../lib/urldata.h:88,
                 from vtls/openssl.c:41:
/usr/include/openssl/err.h:247:1: note: declared here
 DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
 ^
vtls/openssl.c: In function 'verifyhost':
vtls/openssl.c:1095:9: warning: 'ASN1_STRING_data' is deprecated [-Wdeprecated-declarations]
         const char *altptr = (char *)ASN1_STRING_data(check->d.ia5);
         ^
In file included from /usr/include/openssl/bn.h:31:0,
                 from /usr/include/openssl/asn1.h:24,
                 from /usr/include/openssl/objects.h:916,
                 from /usr/include/openssl/evp.h:27,
                 from /usr/include/openssl/x509.h:23,
                 from /usr/include/openssl/ssl.h:50,
                 from ../lib/urldata.h:86,
                 from vtls/openssl.c:41:
/usr/include/openssl/asn1.h:553:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^
vtls/openssl.c:1178:15: warning: 'ASN1_STRING_data' is deprecated [-Wdeprecated-declarations]
               memcpy(peer_CN, ASN1_STRING_data(tmp), j);
               ^
In file included from /usr/include/openssl/bn.h:31:0,
                 from /usr/include/openssl/asn1.h:24,
                 from /usr/include/openssl/objects.h:916,
                 from /usr/include/openssl/evp.h:27,
                 from /usr/include/openssl/x509.h:23,
                 from /usr/include/openssl/ssl.h:50,
                 from ../lib/urldata.h:86,
                 from vtls/openssl.c:41:
/usr/include/openssl/asn1.h:553:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^
vtls/openssl.c: In function 'get_cert_chain':
vtls/openssl.c:2353:29: warning: passing argument 1 of 'X509_get0_signature' from incompatible pointer type [-Wincompatible-pointer-types]
         X509_get0_signature(&psig, &palg, x);
                             ^
In file included from /usr/include/openssl/ssl.h:50:0,
                 from ../lib/urldata.h:86,
                 from vtls/openssl.c:41:
/usr/include/openssl/x509.h:552:6: note: expected 'const ASN1_BIT_STRING ** {aka const struct asn1_string_st **}' but argument is of type 'ASN1_BIT_STRING ** {aka struct asn1_string_st **}'
 void X509_get0_signature(const ASN1_BIT_STRING **psig,
      ^
vtls/openssl.c:2353:36: warning: passing argument 2 of 'X509_get0_signature' from incompatible pointer type [-Wincompatible-pointer-types]
         X509_get0_signature(&psig, &palg, x);
                                    ^
In file included from /usr/include/openssl/ssl.h:50:0,
                 from ../lib/urldata.h:86,
                 from vtls/openssl.c:41:
/usr/include/openssl/x509.h:552:6: note: expected 'const X509_ALGOR ** {aka const struct X509_algor_st **}' but argument is of type 'X509_ALGOR ** {aka struct X509_algor_st **}'
 void X509_get0_signature(const ASN1_BIT_STRING **psig,
      ^
vtls/openssl.c:2360:27: warning: passing argument 3 of 'X509V3_ext' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
       X509V3_ext(data, i, X509_get0_extensions(x));
                           ^
vtls/openssl.c:2246:12: note: expected 'struct stack_st_X509_EXTENSION *' but argument is of type 'const struct stack_st_X509_EXTENSION *'
 static int X509V3_ext(struct SessionHandle *data,
            ^
vtls/openssl.c:2389:20: error: dereferencing pointer to incomplete type 'EVP_PKEY {aka struct evp_pkey_st}'
       switch(pubkey->type) {
                    ^
Makefile:1868: recipe for target 'vtls/libcurl_la-openssl.lo' failed
make[1]: *** [vtls/libcurl_la-openssl.lo] Error 1
make[1]: Leaving directory '/root/curl-7.47.0/lib'
Makefile:880: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
    
por Harry Cameron 14.01.2018 / 17:02

1 resposta

1

No link que você forneceu , de acordo com a primeira onda de comentários que precisa ser instalado a partir da origem com o --disabled-shared executado com o comando ./configure :

Primeiro, pegue a fonte de curl:

apt source curl

Em seguida, vá para a pasta curl: (esta pasta pode ser diferente dependendo da versão baixada)

cd curl-7.47.0/

Pode ser necessário reinstalar as bibliotecas libcurl-openssl antes de executar a próxima parte:

sudo apt install --reinstall libcurl4-openssl-dev

Em seguida, execute o comando configure :

curl-7.47.0$ CPPFLAGS=-I/usr/local/include
curl-7.47.0$ LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
curl-7.47.0$ LIBS="-ldl"
curl-7.47.0$ ./configure --disable-shared

Em seguida, execute os comandos make e make install :

curl-7.47.0$ make
curl-7.47.0$ sudo make install

Em seguida, o curl agora deve mostrar o protocolo sftp :

curl-7.47.0$ curl -V
curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 libssh2/1.5.0
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets 

Espero que isso ajude!

    
por Terrance 14.01.2018 / 17:28