【问题标题】:Ignore SSL errors in R httr connection忽略 R httr 连接中的 SSL 错误
【发布时间】:2016-08-28 03:07:57
【问题描述】:

更新:

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

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 connect error 问题的原因吗?

如何绕过这个并获取数据? 如果您在 linux 命令行中运行,有没有办法轻弹存在的 --insecure 选项?请注意,我在 Windows 上运行 R。

【问题讨论】:

  • readLines 在给定字符串时使用file 连接,而不是url 连接。明确地做,或者更好,试试httr。此外,您的语法有问题。

标签: r curl https httr


【解决方案1】:

只需运行这一行:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-14
    • 1970-01-01
    • 2012-05-10
    • 2014-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多