zaru / webpush

webpush, Encryption Utilities for Web Push protocol
MIT License
394 stars 73 forks source link

pkeys are immutable on OpenSSL 3.0 (OpenSSL::PKey::PKeyError) #111

Closed ravigerardo closed 1 year ago

ravigerardo commented 1 year ago

https://github.com/zaru/webpush/blob/061ff9a88efebe2403a2a1c0dd0b66b96483ae9a/lib/webpush/encryption.rb#L15

I have an app on heroku and when i try to do a payload_send it fails but in my local environment it works fine.

Apparently it is because the implementation of the generate_key method of the Encryption module is no longer supported. And I get the following error: /webpush/encryption.rb:15:in generate_key!': pkeys are immutable on OpenSSL 3.0 (OpenSSL::PKey::PKeyError)

In my local environment:

irb>> OpenSSL::OPENSSL_VERSION
=> "OpenSSL 1.1.1n 15 Mar 2022"

In production on Heroku:

irb>> OpenSSL::OPENSSL_VERSION
=> "OpenSSL 3.0.1 14 Dec 2021"
collimarco commented 1 year ago

https://github.com/zaru/webpush/pull/106