Skip to content

Commit 617e136

Browse files
authored
Merge pull request #9087 from mhashizume/maint/7.x/jruby-tests
(PUP-11935) Update JRuby in tests to 9.3.y.z
2 parents 431cd4f + 760ec82 commit 617e136

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

.github/workflows/rspec_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- {os: ubuntu-latest, ruby: '2.6'}
2121
- {os: ubuntu-latest, ruby: '2.7'}
2222
- {os: ubuntu-latest, ruby: '3.0'}
23-
- {os: ubuntu-latest, ruby: 'jruby-9.2.21.0'}
23+
- {os: ubuntu-latest, ruby: 'jruby-9.3.9.0'}
2424
- {os: windows-2019, ruby: '2.5'}
2525
- {os: windows-2019, ruby: '2.6'}
2626
- {os: windows-2019, ruby: '2.7'}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'spec_helper'
2+
3+
describe Puppet::SSL::CertificateSigner do
4+
include PuppetSpec::Files
5+
6+
let(:wrong_key) { OpenSSL::PKey::RSA.new(512) }
7+
let(:client_cert) { cert_fixture('signed.pem') }
8+
9+
# jruby-openssl >= 0.13.0 (JRuby >= 9.3.5.0) raises an error when signing a
10+
# certificate when there is a discrepancy between the certificate and key.
11+
it 'raises if client cert signature is invalid', if: Puppet::Util::Platform.jruby? && RUBY_VERSION.to_f >= 2.6 do
12+
expect {
13+
client_cert.sign(wrong_key, OpenSSL::Digest::SHA256.new)
14+
}.to raise_error(OpenSSL::X509::CertificateError,
15+
'invalid public key data')
16+
end
17+
end

spec/unit/ssl/ssl_provider_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
).to eq(['CN=signed', 'CN=Test CA Subauthority', 'CN=Test CA'])
299299
end
300300

301-
it 'raises if client cert signature is invalid' do
301+
it 'raises if client cert signature is invalid', unless: Puppet::Util::Platform.jruby? && RUBY_VERSION.to_f >= 2.6 do
302302
client_cert.sign(wrong_key, OpenSSL::Digest::SHA256.new)
303303
expect {
304304
subject.create_context(**config.merge(client_cert: client_cert))
@@ -337,7 +337,7 @@
337337
end
338338
end
339339

340-
it 'raises if intermediate CA signature is invalid' do
340+
it 'raises if intermediate CA signature is invalid', unless: Puppet::Util::Platform.jruby? && RUBY_VERSION.to_f >= 2.6 do
341341
int = global_cacerts.last
342342
int.sign(wrong_key, OpenSSL::Digest::SHA256.new)
343343

0 commit comments

Comments
 (0)