简体   繁体   中英

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:

     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.

  • 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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