You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 Java HotSpot(TM) 64-Bit Server VM 25.112-b15 on 1.8.0_112-b15 +jit [mswin32-x86_64]
OS: windows 7 enterprise SP1
Expected Behavior
Can read the OpenSSL::X509::Certificate previously created using this sample code
`require 'openssl'
name = OpenSSL::X509::Name.parse("CN=example.com/C=EE")
cert = OpenSSL::X509::Certificate.new
cert.version = 2
cert.serial = 0
cert.not_before = Time.now
cert.not_after = cert.not_before + 1 * 365 * 24 * 60 * 60 # 1 year validity
key = OpenSSL::PKey::RSA.new(2048)
cert.public_key = key.public_key
cert.subject = name
cert.issuer = name
cert.sign key, OpenSSL::Digest::SHA1.new
cert_path = "C:/temp/cert.der"
open cert_path, "w" do |io| io.write cert.to_der end
begin
raw = File.read cert_path # DER- or PEM-encoded
certificate = OpenSSL::X509::Certificate.new raw
puts certificate.inspect
rescue => exception
puts exception.backtrace
puts exception.inspect
end
Actual Behavior
reading the certificate throws an exception #<OpenSSL::X509::CertificateError: No message available>
FYI, this sample code works using
the same jruby/jdk on linux rh6
jruby 1.7.24 on the same OS (windows 7 enterprise SP1)
It also works if you replace raw = File.read cert_path
with raw = File.binread cert_path
The text was updated successfully, but these errors were encountered:
jacquesdufeu
changed the title
can't read OpenSSL::X509::Certificate in der format jruby9000 for windows
can't read OpenSSL::X509::Certificate in der format using jruby9000 for windows
Nov 14, 2016
Environment
Expected Behavior
Can read the OpenSSL::X509::Certificate previously created using this sample code
Actual Behavior
reading the certificate throws an exception
#<OpenSSL::X509::CertificateError: No message available>
FYI, this sample code works using
the same jruby/jdk on linux rh6
jruby 1.7.24 on the same OS (windows 7 enterprise SP1)
It also works if you replace
raw = File.read cert_path
with
raw = File.binread cert_path
The text was updated successfully, but these errors were encountered: