ostinelli / apnotic

A Ruby APNs HTTP/2 gem able to provide instant feedback.
MIT License
479 stars 94 forks source link

Ruby 3.1.2 - failure with p12 certificate #122

Closed bjer closed 1 year ago

bjer commented 2 years ago

In a rails app 7.0.4 using ruby 3.1.2 the following fails:

connection = Apnotic::Connection.new(cert_path: "#{Rails.root}/push_package/certificate.p12", cert_pass: "my_really_good_pass")

/rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/apnotic-1.7.0/lib/apnotic/connection.rb:118:in `initialize': PKCS12_parse: unsupported (OpenSSL::PKCS12::PKCS12Error)

Workaround: convert the .p12 certificate to .pem !

benubois commented 1 year ago

Hi @bjer,

I ran into this recently too. It turns out it's related to OpenSSL 3.0 dropping support for some older algorithms. I think it can also be fixed by updating your certs to something generated with OpenSSL 3.