简体   繁体   English

Ruby 2.5.1,Rails 5.1.6,HTTParty发布返回OpenSSL错误

[英]Ruby 2.5.1, Rails 5.1.6, HTTParty post returns OpenSSL error

我正在运行一个控制台实用程序,我尝试过经过验证的:false,只是在运行此命令时确定它是客户端还是服务器问题:

Given the information in the comments I seems that the client and the server can't negotiate which cryptographic protocol to use. 鉴于注释中的信息,我似乎客户端和服务器无法协商使用哪种加密协议。

In order to fix this you might need to do one of the following things: 为了解决此问题,您可能需要执行以下操作之一:

  • You can try to use specific ssl version on the request: 您可以尝试在请求中使用特定的ssl版本:

     HTTParty.post(url, body: payload.to_json, ssl_version: :TLSv1) 

You can find all supported :ssl_versions values by using OpenSSL::SSL::SSLContext::METHODS in the rails console and try to use some of them. 您可以通过在Rails控制台中使用OpenSSL::SSL::SSLContext::METHODS找到所有受支持的:ssl_versions值,并尝试使用其中的一些。

  • If the server does support only SSLv3 (which is not secure ), you might need to rebuild openssl with ssl3 support on your machine or if you have access to the server to set it up so it supports more secure protocols. 如果服务器仅仅支持SSLv3(这不是安全的 ),则可能需要在计算机上使用ssl3支持来重建openssl ,或者如果您有权访问服务器进行设置以使其支持更安全的协议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM