忽略R httr连接中的SSL错误 [英] Ignore SSL errors in R httr connection

查看:98
本文介绍了忽略R httr连接中的SSL错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已更新:

我正在尝试使用以下方式访问公司内部的Web API:

I am trying to access a corporate internal web API using:

require(httr)
url = 'https://my_server/api/search/query?q=stuff'
httr::set_config( config(ssl_verifypeer = 0L) )
data <- httr::GET( url, use_proxy(url = "ipaddress:port"), verbose() )

我得到:

-> CONNECT my_server:port HTTP/1.1
-> Host: my_server:port
-> User-Agent: libcurl/7.47.1 r-curl/0.9.7 httr/1.1.0
-> Proxy-Connection: Keep-Alive
-> 
<- HTTP/1.1 200 Connection established
<- 
Error in curl::curl_fetch_memory(url, handle = handle) : 
  SSL connect error    

我使用了 ssl_verifypeer ,因为该证书的CA证书存在问题服务器。是什么导致 SSL连接错误的问题?

I used ssl_verifypeer as there are issues with the CA cert of the server. is that what is causing the issue with the SSL connect error ?

如何绕过此方法并获取数据?
是否可以轻拂-insecure 选项(如果您在linux命令行中运行)?注意我虽然在Windows上运行R。

How do I bypass this and get the data? is there a way to flick the --insecure option that exists if you run in the linux command line? Note I am running R on windows though.

推荐答案

只需运行以下行:

httr::set_config(config(ssl_verifypeer = 0L))

这篇关于忽略R httr连接中的SSL错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆