@@ -219,8 +219,17 @@ def test_inspect_to_text
219
219
cert = issue_cert ( subj , key , s , now , now + 3600 , exts , nil , nil , dgst )
220
220
221
221
assert cert . inspect . start_with? ( '#<OpenSSL::X509::Certificate:' )
222
- assert cert . inspect . index ( 'subject=/DC=org/DC=ruby-lang/CN=TestCA, issuer=/DC=org/DC=ruby-lang/CN=TestCA' )
223
- assert cert . inspect . index ( 'serial=295990750012446699619010157040970350255' )
222
+ if defined? JRUBY_VERSION
223
+ assert cert . inspect . index ( 'subject=/DC=org/DC=ruby-lang/CN=TestCA, issuer=/DC=org/DC=ruby-lang/CN=TestCA' )
224
+ assert cert . inspect . index ( 'serial=295990750012446699619010157040970350255' )
225
+ # TODO this isn't MRI compatible, which gives :
226
+ # #<OpenSSL::X509::Certificate:
227
+ # subject=#<OpenSSL::X509::Name CN=TestCA,DC=ruby-lang,DC=org>,
228
+ # issuer=#<OpenSSL::X509::Name CN=TestCA,DC=ruby-lang,DC=org>,
229
+ # serial=#<OpenSSL::BN:0x00005627d4602938>,
230
+ # not_before=2014-10-09 07:34:20 UTC,
231
+ # not_after=2014-10-09 08:34:20 UTC>
232
+ end
224
233
#assert cert.inspect.index('not_before=2014-10-09 07:34:20 UTC, not_after=2014-10-09 08:34:20 UTC')
225
234
226
235
text_without_signature = <<-TEXT
@@ -313,7 +322,7 @@ def test_to_text_read_back
313
322
crt = File . expand_path ( 'ca.crt' , File . dirname ( __FILE__ ) )
314
323
cert = OpenSSL ::X509 ::Certificate . new File . read ( crt )
315
324
assert cert . to_text . index ( 'X509v3 Authority Key Identifier:' )
316
- assert cert . to_text . match /X509v3 Authority Key Identifier:\s *keyid:BA:5E:E9:90:3B:5B:F6:79:A2:D3:65:09:C5:39:6A:E7:43:6B:F8:3D /m
325
+ assert cert . to_text . match /X509v3 Authority Key Identifier:\s *keyid:C6:17:42:6B:7F:B6:44:30:67:01:3D:44:83:9D:0F:B4:52:A1:D7:B7 /m
317
326
end
318
327
319
328
def test_to_text_npe_regression
0 commit comments