We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8882950 + a35040c commit 954b16dCopy full SHA for 954b16d
1 file changed
spec/unit/ssl/certificate_request_spec.rb
@@ -69,6 +69,17 @@
69
end
70
71
72
+ def sha1_signing_supported?
73
+ test_key = OpenSSL::PKey::RSA.new(512)
74
+ csr = OpenSSL::X509::Request.new
75
+ csr.public_key = test_key.public_key
76
+ csr.version = 0
77
+ csr.sign(test_key, OpenSSL::Digest::SHA1.new)
78
+ true
79
+ rescue
80
+ false
81
+ end
82
+
83
describe "when generating", :unless => RUBY_PLATFORM == 'java' do
84
it "should verify the CSR using the public key associated with the private key" do
85
request.generate(key)
@@ -312,6 +323,7 @@
312
323
313
324
314
325
it "should use SHA1 to sign the csr when SHA256 isn't available" do
326
+ skip "SHA1 signing not supported by this OpenSSL build" unless sha1_signing_supported?
315
327
csr = OpenSSL::X509::Request.new
316
328
csr.public_key = key.public_key
317
329
csr.version = 0
0 commit comments