OpenSSL::PKey.read throws a null pointer exception #1784

Closed
mehmetc opened this Issue Jul 3, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@mehmetc

mehmetc commented Jul 3, 2014

OpenSSL::PKey.read throws a null pointer exception when reading an encrypted key. I found an old Jira entry if it helps.

require 'openssl'
require 'open-uri'

pass = "secure-password!42"
cert = open('https://raw.githubusercontent.com/savonrb/savon/master/spec/fixtures/ssl/client_encrypted_key.pem') {|f| f.read}

r = OpenSSL::PKey.read(cert, pass)

@kares kares added the openssl label Jan 17, 2017

@kares

This comment has been minimized.

Show comment
Hide comment
@kares

kares Jan 17, 2017

Member

still present - filling in backtrace information :

jruby-9.1.7.0 :007 >   r = OpenSSL::PKey.read(cert, pass)
Java::JavaLang::NullPointerException: 
	from org.jruby.ext.openssl.PKey$PKeyModule.read(PKey.java:128)
	from org.jruby.ext.openssl.PKey$PKeyModule$INVOKER$s$0$1$read.call(PKey$PKeyModule$INVOKER$s$0$1$read.gen)
	from org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:724)
	from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
	from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
	from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
	from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
	from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
	from org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:122)
	from org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:176)
	from org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:200)
	from org.jruby.RubyKernel.evalCommon(RubyKernel.java:1033)
	from org.jruby.RubyKernel.eval19(RubyKernel.java:1000)
	from org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(RubyKernel$INVOKER$s$0$3$eval19.gen)
Member

kares commented Jan 17, 2017

still present - filling in backtrace information :

jruby-9.1.7.0 :007 >   r = OpenSSL::PKey.read(cert, pass)
Java::JavaLang::NullPointerException: 
	from org.jruby.ext.openssl.PKey$PKeyModule.read(PKey.java:128)
	from org.jruby.ext.openssl.PKey$PKeyModule$INVOKER$s$0$1$read.call(PKey$PKeyModule$INVOKER$s$0$1$read.gen)
	from org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:724)
	from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
	from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
	from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
	from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
	from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
	from org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:122)
	from org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:176)
	from org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:200)
	from org.jruby.RubyKernel.evalCommon(RubyKernel.java:1033)
	from org.jruby.RubyKernel.eval19(RubyKernel.java:1000)
	from org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(RubyKernel$INVOKER$s$0$3$eval19.gen)

@kares kares added this to the JRuby 9.1.8.0 milestone Jan 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment