Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

mehmetc opened this issue Jul 3, 2014 · 1 comment
Labels
Milestone

Comments

@mehmetc
Copy link

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
Copy link
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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants