craysiii / binance

API Wrapper for the Binance cryptocurrency exchange written in Ruby.
MIT License
97 stars 79 forks source link

how enable tls 1.1 or 1.2? #23

Closed sunnmas closed 6 years ago

sunnmas commented 6 years ago
require 'binance'

api_key = 'jAd....7y95dV6jqUesI4np'
secret_key = '...'

client = Binance::Client::REST.new
client = Binance::Client::REST.new api_key: api_key, secret_key: secret_key
p client.ping

sslv3 alert handshake failure (Faraday::SSLError)

server support only tls 1.1 and 1.2

How setup this?

craysiii commented 6 years ago

Hey there, thanks for reporting the issue.

What environment are you running this in? I am boarding a plane for vacation and will look at this ASAP. Thanks.

sunnmas commented 6 years ago

ruby 2.1 windows 8.1

craysiii commented 6 years ago

Without taking a look to deep, I believe that version of Ruby might be too old. I’ll install and test on my Ubuntu setup to see if I can reproduce.

craysiii commented 6 years ago

After some review, I've found the solution for you. https://stackoverflow.com/questions/11059059/is-it-possible-to-enable-tls-v1-2-in-ruby-if-so-how

However, I would really recommend upgrading your version of Ruby, as 2.1 is no longer supported. You could upgrade to 2.3 if you are trying to lessen the amount of issues that could arise, but 2.5 would be recommended.