Skip to content

Commit 3a31a20

Browse files
anakinjCopilot
andauthored
Fix compatibility with ruby-head (#706)
* Fix compatibility with openssl * Changelog and versions * Update CHANGELOG.md Co-authored-by: Copilot <[email protected]> * Update CHANGELOG.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 8d21f95 commit 3a31a20

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [v3.1.3](https://github.com/jwt/ruby-jwt/tree/v3.1.3) (NEXT)
4+
5+
[Full Changelog](https://github.com/jwt/ruby-jwt/compare/v3.1.2...v3.1.3)
6+
7+
**Features:**
8+
9+
- Your contribution here
10+
11+
**Fixes and enhancements:**
12+
13+
- Fix compatibility with the openssl 4.0 gem [#706](https://github.com/jwt/ruby-jwt/pull/706)
14+
- Your contribution here
15+
316
## [v3.1.2](https://github.com/jwt/ruby-jwt/tree/v3.1.2) (2025-06-28)
417

518
[Full Changelog](https://github.com/jwt/ruby-jwt/compare/v3.1.1...v3.1.2)

lib/jwt/jwk/rsa.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def validate_rsa_parameters!(rsa_parameters)
195195

196196
if ::JWT.openssl_3?
197197
alias create_rsa_key create_rsa_key_using_der
198-
elsif OpenSSL::PKey::RSA.new.respond_to?(:set_key)
198+
elsif OpenSSL::PKey::RSA.method_defined?(:set_key)
199199
alias create_rsa_key create_rsa_key_using_sets
200200
else
201201
alias create_rsa_key create_rsa_key_using_accessors

lib/jwt/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def self.gem_version
1616
module VERSION
1717
MAJOR = 3
1818
MINOR = 1
19-
TINY = 2
19+
TINY = 3
2020
PRE = nil
2121

2222
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')

spec/jwt/jwk/rsa_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262

263263
describe '.create_rsa_key_using_sets' do
264264
before do
265-
skip 'OpenSSL without the RSA#set_key method not supported' unless OpenSSL::PKey::RSA.new.respond_to?(:set_key)
265+
skip 'OpenSSL without the RSA#set_key method not supported' unless OpenSSL::PKey::RSA.method_defined?(:set_key)
266266
skip 'OpenSSL 3.0 does not allow mutating objects anymore' if JWT.openssl_3?
267267
end
268268

@@ -274,7 +274,7 @@
274274

275275
describe '.create_rsa_key_using_accessors' do
276276
before do
277-
skip 'OpenSSL if RSA#d= is not available there is no accessors anymore' unless OpenSSL::PKey::RSA.new.respond_to?(:d=)
277+
skip 'OpenSSL if RSA#d= is not available there is no accessors anymore' unless OpenSSL::PKey::RSA.method_defined?(:d=)
278278
end
279279

280280
subject(:rsa) { described_class.create_rsa_key_using_accessors(rsa_parameters) }

0 commit comments

Comments
 (0)