bitpay / ruby-client

Powerful, flexible, lightweight SDK for the BitPay Bitcoin Payment Gateway API.
MIT License
79 stars 64 forks source link

OpenSSL::PKey::ECError #60

Open utiq opened 7 years ago

utiq commented 7 years ago

I have this piece of code to initialize my client prevouilsy associated to my bitpay account

path = File.join(Rails.root, 'config', 'bitpaykey.pem')
pem = File.read(path)
client = BitPay::SDK::Client.new(api_uri: 'https://test.bitpay.com', pem: pem, insecure: true, debug: true)

But when I try to create an invoice, I get this error: OpenSSL::PKey::ECError: invalid curve name

I'm using this sdk version gem 'bitpay-sdk', :git => 'git://github.com/bitpay/ruby-client.git'

Rails 5.1.0 Ruby 2.4

laura-levelup commented 6 years ago

Not sure if you already figured out your issue, but I'm guessing that your certificate is not valid, and it's failing here: https://github.com/bitpay/bitpay-ruby-keyutils/blob/master/lib/bitpay/key_utils.rb#L21

> OpenSSL::PKey::EC.new('test')
OpenSSL::PKey::ECError: invalid curve name