How to update libcurl version used by R on Ubuntu 18.04 - r

Since I have to use the sftp protocol to retrieve some documents from a remote server I reinstalled the curl library with ssl.
The curl --version now correctly returns
curl 7.72.0 (x86_64-pc-linux-gnu) libcurl / 7.72.0 OpenSSL / 1.1.1 zlib / 1.2.11 brotli / 1.0.4 libidn2 / 2.0.4 libpsl / 0.19.1 (+ libidn2 / 2.0.4 ) libssh / 0.7.0 / openssl / zlib nghttp2 / 1.30.0 librtmp / 2.3
Release-Date: 2020-08-19
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
and the sftp protocol is now enabled.
In R I tried to reinstall the RCurl package from source with install.package('RCurl', type = 'source') but the libcurlVersion() command keeps returning
[1] "7.58.0"
attr (, "ssl_version")
[1] "OpenSSL / 1.1.1"
attr (, "libssh_version")
[1] ""
attr (, "protocols")
[1] "dict" "file" "ftp" "ftps" "gopher" "http" "https" "imap"
[9] "imaps" "ldap" "ldaps" "pop3" "pop3s" "rtmp" "rtsp" "smb"
[17] "smbs" "smtp" "smtps" "telnet" "tftp"
where, as you can see, the library version is different from the one installed on the machine and the sftp protocol is not enabled.
How can I force R to use the correct curl version?

You need to re-install Older curl to solve the issue. You can specify the version of curl what you want, the guide build curl by source code
exampe:
wget https://curl.haxx.se/download/curl-7.58.0.zip
The guide to re-install curl by zip
https://yannmjl.medium.com/how-to-manually-update-curl-on-ubuntu-server-899476062ad6

Related

How to install specific version 3.3.1 of R in CentOS

I'm tring to install R_3.3.1 in CentOS.
So i download tar file and build it.
During build this file i got some erros because of the defendency.
I solve this errors by reference.
https://oguya.ch/posts/2017-03-18-building-R-on-rhel-6/ here.
But At the libcurl step.I can't solve it.
checking if libcurl is version 7 and >= 7.28.0... yes
checking if libcurl supports https... no
configure: error: libcurl >= 7.28.0 library and headers are required with support for https
and My curl version is 7.47.1 so i think version is not matter
[nubiz#localhost R-3.3.1]$ curl --version
curl 7.47.1 (x86_64-pc-linux-gnu) libcurl/7.47.1 zlib/1.2.8
Protocols: dict file ftp gopher http imap pop3 rtsp smtp telnet tftp
but the error say this libcurl can't use http.
So is there any version can use http or something way to this error?
I check my protocols what can i use in curl using this command 'curl-config --protocols'
And i can using only HTTP like this
DICT
FILE
FTP
GOPHER
HTTP
IMAP
POP3
RTSP
SMTP
TELNET
TFTP
it can be enable to HTTPS?

sftp with R - sftp not a protocol with RCurl

I've read a few posts on sftp with R, but was not able to address the problem that I have. There's a decent change I'm just not searching in the right place, and if that's the case, please point me in the right direction. Here's where I'm at:
> library(RCurl)
> curlVersion()
$age
[1] 3
$version
[1] "7.43.0"
$vesion_num
[1] 469760
$host
[1] "x86_64-apple-darwin15.0"
$features
ipv6 ssl libz ntlm asynchdns spnego largefile ntlm_wb
1 4 8 16 128 256 512 32768
$ssl_version
[1] "SecureTransport"
$ssl_version_num
[1] 0
$libz_version
[1] "1.2.5"
$protocols
[1] "dict" "file" "ftp" "ftps" "gopher" "http" "https" "imap" "imaps" "ldap" "ldaps" "pop3" "pop3s" "rtsp" "smb" "smbs" "smtp" "smtps" "telnet" "tftp"
$ares
[1] ""
$ares_num
[1] 0
$libidn
[1] ""
Right away, I notice that sftp is not a protocol accepted in my current version of RCurl, which is my main problem. As a result, when I run the following code below, I get the following error:
# Input
protocol <- "sftp"
server <- "00.000.00.00"
userpwd <- "userid:userpass"
tsfrFilename <- 'myfile.txt'
ouptFilename <- 'myfile.txt'
# Run
url <- paste0(protocol, "://", server, tsfrFilename)
data <- getURL(url = url, userpwd = userpwd)
Error in function (type, msg, asError = TRUE) :
Protocol "sftp" not supported or disabled in libcurl
I actually have a second question as well. My understanding is that getURL grabs data from the other server and pulls it to my local machine, whereas I would like to put a file onto the server from my local machine.
To summarize: (1) can I update RCurl / libcurl in R to support sftp, and (2) how do i put files from my local machine into the server, rather than get files from the server to my local machine?
Thanks!
I found the answer, for the most part...
http://andrewberls.com/blog/post/adding-sftp-support-to-curl - following this link addressed the problem for me.
I've successfully added sftp support to cURL, however I am now struggling to update the RCurl package to have the same...

Secured Elastic Search R connection Error - Client requested protocal TLSv1 not enabled or not supported

I use the elastic 0.7.8 R package to connect to my Elastic Search instance.
Recently, I tried to secure the Elastic Search by using Search Guard 2.
Everything work fines after securing it.
But when I try to connect from R, it fails.
library(elastic)
connect(es_base = "https://localhost", es_port = 9200, es_user = USER, es_pwd = PASS)
The error in the log is "Client requested protocal TLSv1 not enabled or not supported"
I tried to connect to Elastic Search using cURL as below:
curl -k --tlsv1.1 -u USER:PASS https://localhost:9200 (This works)
curl -k --tlsv1.0 -u USER:PASS https://localhost:9200 (This fails)
I am unable to figure out how to force R to use TLSv1.1.
Please assist.
Below are the version:
R : 3.3.1
Elastic Search: 2.4.1
GCC: 4.9.2
OS: RHEL 6.7
Openssl: 1.0.1.e-fips 11 Feb 2013
In elasticsearch.yml simply set
searchguard.ssl.http.enabled_protocols:
- "TLSv1.2"
- "TLSv1.1"
- "TLSv1"
See also https://github.com/floragunncom/search-guard-ssl/blob/master/searchguard-ssl-config-template.yml

how do you enable sftp with RCurl package

I am trying to install RCurl package that has sftp support. I install curl with sftp. On console, when I do curl -V, I do get the list of protocols supported:
curl 7.39.0 (x86_64-unknown-linux-gnu) libcurl/7.39.0 OpenSSL/0.9.8j zlib/1.2.7 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: Largefile NTLM NTLM_WB SSL libz
However, when I try to install RCurl version RCurl_1.95, I dont see sftp as one of the protocols:
curlVersion()$protocols
[1] "tftp" "ftp" "telnet" "dict" "ldap" "ldaps" "http" "file"
[9] "https" "ftps"
Is there a way to force Rcurl include sftp when manually installing the RCurl from the source?
I do not thinks so. While curl/libcurl might provide a huge amount of protocols -- as far as I understand the matter -- RCurl does not port all theoretically available protocols to be used in R.
You might either do that yourself or maybe kindly ask Duncan Temple Lang to add further protocols. A workaround might be to access curl from within R via shell() like this:
shell("curl example.com", intern = TRUE)

Installing nginx via macports with ngx_echo module available

The ngx_echo module isn't included when I install nginx by:
sudo port install nginx
I looked at the portfile and the variants are:
addition dav debug flv geoip google_perftools gzip_static ipv6 mail perl5 realip redis secure_download ssl status substitution upload zip
Is ngx_echo included in any of those options?
I compiled it using macports as mentioned in the link below
https://serverfault.com/questions/328416/how-to-set-random-value-in-the-specified-range-in-variable/347191#347191

Resources