? Thu, 12 Sep 2024 12:01:54 +0000 Simon Andrews via R-devel <r-devel at r-project.org> ?????:> readRDS('https://seurat.nygenome.org/azimuth/references/homologs.rds') > Error in gzfile(file, "rb") : cannot open the connectionI don't think that gzfile works with URLs. gzcon(), on the other hand, does work with url() connections, which accepts the 'method' argument and the getOption('url.method') default. h <- readRDS(url( 'https://seurat.nygenome.org/azimuth/references/homologs.rds' )) But that only works with gzip-compressed files. For example, CRAN's PACKAGES.rds is xz-compressed, and I don't see a way to read it the same way: readBin( index <- file.path( contrib.url(getOption('repos')['CRAN']), 'PACKAGES.rds' ), raw(), 5 ) |> rawToChar() # [1] "\xfd7zXZ" <-- note the "7zXZ" header readRDS(url(index)) # Error in readRDS(url(index)) : unknown input format> 2. Given the warnings we're getting when using wininet, are their > plans to make windows certficates be supported in another way?What does libcurlVersion() return for you? In theory, it should be possible to make libcurl use schannel and therefore the system certificate store for TLS verification purposes. -- Best regards, Ivan
Simon Andrews
2024-Sep-12 15:06 UTC
[Rd] Can gzfile be given the same method option as file
Thankyou! This helped a lot. I had mis-understood some of the chain of functions which got to the eventual failure. I can confirm that it does indeed work if you create a url() first and it picks the appropriate back end as long as the url.method option is set. For the schannel back end I have:> libcurlVersion()[1] "8.6.0" attr(,"ssl_version") [1] "(OpenSSL/3.2.1) Schannel" attr(,"libssh_version") [1] "libssh2/1.11.0" However I can't get either of the curl related methods to work.> download.file('https://seurat.nygenome.org/azimuth/references/homologs.rds', destfile = "c:/Users/andrewss/homologs.rds", method="libcurl")trying URL 'https://seurat.nygenome.org/azimuth/references/homologs.rds' Error in download.file("https://seurat.nygenome.org/azimuth/references/homologs.rds", : cannot open URL 'https://seurat.nygenome.org/azimuth/references/homologs.rds' In addition: Warning message: In download.file("https://seurat.nygenome.org/azimuth/references/homologs.rds", : URL 'https://seurat.nygenome.org/azimuth/references/homologs.rds': status was 'SSL connect error'> download.file('https://seurat.nygenome.org/azimuth/references/homologs.rds', destfile = "c:/Users/andrewss/homologs.rds", method="curl")% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (35) schannel: next InitializeSecurityContext failed: CRYPT_E_NO_REVOCATION_CHECK (0x80092012) - The revocation function was unable to check revocation for the certificate. Error in download.file("https://seurat.nygenome.org/azimuth/references/homologs.rds", : 'curl' call had nonzero exit status I realise that this may not be as simple as the certificate not being seen, and that the system here may not fake the revocation infrastructure too, but I don't see that this is going to change, and it's only the winet method which actually allows anything to connect. Simon. -----Original Message----- From: Ivan Krylov <ikrylov at disroot.org> Sent: 12 September 2024 15:28 To: Simon Andrews via R-devel <r-devel at r-project.org> Cc: Simon Andrews <simon.andrews at babraham.ac.uk> Subject: Re: [Rd] Can gzfile be given the same method option as file ? Thu, 12 Sep 2024 12:01:54 +0000 Simon Andrews via R-devel <r-devel at r-project.org> ?????:> readRDS('https://seurat.nygenome.org/azimuth/references/homologs.rds') > Error in gzfile(file, "rb") : cannot open the connectionI don't think that gzfile works with URLs. gzcon(), on the other hand, does work with url() connections, which accepts the 'method' argument and the getOption('url.method') default. h <- readRDS(url( 'https://seurat.nygenome.org/azimuth/references/homologs.rds' )) But that only works with gzip-compressed files. For example, CRAN's PACKAGES.rds is xz-compressed, and I don't see a way to read it the same way: readBin( index <- file.path( contrib.url(getOption('repos')['CRAN']), 'PACKAGES.rds' ), raw(), 5 ) |> rawToChar() # [1] "\xfd7zXZ" <-- note the "7zXZ" header readRDS(url(index)) # Error in readRDS(url(index)) : unknown input format> 2. Given the warnings we're getting when using wininet, are their > plans to make windows certficates be supported in another way?What does libcurlVersion() return for you? In theory, it should be possible to make libcurl use schannel and therefore the system certificate store for TLS verification purposes. -- Best regards, Ivan ------------------------------------ This email has been scanned for spam & viruses. If you believe this email should have been stopped by our filters, click the following link to report it (https://portal-uk.mailanyone.net/index.html#/outer/reportspam?token=dXNlcj1zaW1vbi5hbmRyZXdzQGJhYnJhaGFtLmFjLnVrO3RzPTE3MjYxNTEyNjU7dXVpZD02NkUyRkE2MDJDNjczRjRCREUwOTMxQUM4NTdCNkY3Nzt0b2tlbj1lNWI5MzU2NGJmOWE1MTcwYmM4ZmY2YjNhNTYwMWQ5ZmFkOTU2YWE1Ow%3D%3D).