2

我有一个在开发中运行良好的 hydra 请求。但生产失败。响应看起来像这样

options:
  :return_code: :ok
  :response_headers: ! "HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=utf-8\r\nTransfer-Encoding:
    chunked\r\nConnection: keep-alive\r\nStatus: 200\r\nX-Powered-By: Phusion Passenger
    (mod_rails/mod_rack) 3.0.19\r\nX-UA-Compatible: IE=Edge,chrome=1\r\nETag: \"2ef0bc08f9b4fa4c7ecc4092f387c4c7\"\r\nCache-Control:
    max-age=0, private, must-revalidate\r\nX-Request-Id: df304fd28b406f8b3a97c84a7ce4de5e\r\nX-Runtime:
    0.614748\r\nDate: Sat, 27 Jul 2013 08:03:09 GMT\r\nX-Rack-Cache: invalidate, pass\r\nServer:
    nginx/1.2.6 + Phusion Passenger 3.0.19\r\n\r\n"
  :response_body: ! '{"status":"success","message":"Message Sent","code":"200"}'
  :httpauth_avail: 0
  :total_time: 5.700828
  :starttransfer_time: 5.700666
  :appconnect_time: 4.387121
  :pretransfer_time: 4.387193
  :connect_time: 0.446846
  :namelookup_time: 0.001348
  :effective_url: !binary |-
    aHR0cHM6Ly9maXJlZmx5YXBpLmNvbS9hcGkvc21z
  :primary_ip: !binary |-
    MTczLjI0Ni40MC4yNA==
  :response_code: 200

但在生产中它返回一个ssl_cacert代码:

options:
  :return_code: :ssl_cacert
  :response_headers: ''
  :response_body: ''
  :httpauth_avail: 0
  :total_time: 0.419993
  :starttransfer_time: 0.0
  :appconnect_time: 0.0
  :pretransfer_time: 0.0
  :connect_time: 0.321081
  :namelookup_time: 0.245361
  :effective_url: !binary |-
    aHR0cHM6Ly9maXJlZmx5YXBpLmNvbS9hcGkvc21z
  :primary_ip: !binary |-
    MTczLjI0Ni40MC4yNA==
  :response_code: 0

知道为什么会这样吗?

4

2 回答 2

3

我面临同样的问题

虽然ssl_verifypeer: false工作正常,但我安装libcurl4-openssl-dev在我的机器(Ubuntu)上,现在它可以很好地验证证书,而不使用将 verifypeer 设置为 false

于 2014-05-15T09:42:49.543 回答
1

通过将以下内容添加到 typhoeus 请求来解决此问题:

ssl_verifypeer: false

多谢你们!

于 2013-07-27T08:32:30.237 回答