Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

devtools::install_github() - Ignore SSL cert verification failure

Tags:

r

devtools

rcurl

I'm trying to get devtools::install_github() working behind my corporate proxy on Windows 7.

So far I've had to do the following:

> library(httr)
> library(devtools)
> set_config(use_proxy("123.123.123.123",8080))
> devtools::install_github("rstudio/ggvis")

Installing github repo ggvis/master from rstudio
Downloading master.zip from https://github.com/rstudio/ggvis/archive/master.zip
Error in function (type, msg, asError = TRUE)  : 
  SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Apparently we have some kind of certificate server replacing SSL certs with our own corporate SSL certs (confirmed by going to https://github.com and examining the cert).

Anyhow, just wondering if there's a way to ignore that cert error and proceed with the installation?

like image 614
Tommy O'Dell Avatar asked Jul 17 '14 02:07

Tommy O'Dell


People also ask

How do I bypass a validation certificate?

To bypass SSL certificate validation for local and test servers, you can pass the -k or --insecure option to the Curl command. This option explicitly tells Curl to perform "insecure" SSL connections and file transfers. Curl will ignore any security warnings about an invalid SSL certificate and accept it as valid.

Why does SSL verification fail?

What Causes an SSL Certificate_Verify_Failed Error? SSL certificate_verify_failed errors typically occur as a result of outdated Python default certificates or invalid root certificates. If you're a website owner and you're receiving this error, it could be because you're not using a valid SSL certificate.

How do I inspect my SSL certificate?

To check an SSL certificate on any website, all you need to do is follow two simple steps. First, check if the URL of the website begins with HTTPS, where S indicates it has an SSL certificate. Second, click on the padlock icon on the address bar to check all the detailed information related to the certificate.


1 Answers

One way to handle the problem is to set the CURLOPT_SSL_VERIFYPEER to false. This option determines whether curl verifies the authenticity of the peer's certificate. A value of 1 means curl verifies; 0 (zero) means it doesn't. http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html

The relevant option needs to be passed to RCurl. In RCurl the CURLOPT_ is removed letters arre lowercase and the underscore is changed to ..

set_config( config( ssl.verifypeer = 0L ) )

will pass the relevant option to RCurl when using httr.

UPDATE:

The httr since this answer was written has moved from RCurl as an underlying dependence to the curl package. cURL options are now specified with underscores so the above would be:

set_config( config( ssl_verifypeer = 0L ) )

in the current version of httr.

like image 166
jdharrison Avatar answered Sep 29 '22 16:09

jdharrison