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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java::JavaLang::ClassCastException (org.jruby.RubyString cannot be cast to org.jruby.ext.openssl.ASN1$ASN1Data) #264

Open
HoneyryderChuck opened this issue Aug 20, 2022 · 0 comments 路 May be fixed by #265

Comments

@HoneyryderChuck
Copy link
Contributor

Hi 馃憢 ,

I'm getting the following error when transforming a given ASN1Data structure to der:

asn = OpenSSL::ASN1::ASN1Data.new("bla", 0, :APPLICATION).
asn.to_der

#       16: from org.jruby.ir.instructions.CallBase.interpret(CallBase.java:549)
#       15: from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:85)
#       14: from org.jruby.RubyKernel$INVOKER$s$0$3$eval.call(RubyKernel$INVOKER$s$0$3$eval.gen)
#       13: from org.jruby.RubyKernel.eval(RubyKernel.java:1091)
#       12: from org.jruby.RubyKernel.evalCommon(RubyKernel.java:1129)
#       11: from org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:182)
#       10: from org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:157)
#        9: from org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:106)
#        8: from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
#        7: from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345)
#        6: from org.jruby.runtime.callsite.RefinedCachingCallSite.call(RefinedCachingCallSite.java:59)
#        5: from org.jruby.ext.openssl.ASN1$ASN1Data$INVOKER$i$0$0$to_der.call(ASN1$ASN1Data$INVOKER$i$0$0$to_der.gen)
#        4: from org.jruby.ext.openssl.ASN1$ASN1Data.to_der(ASN1.java:1412)
#        3: from org.jruby.ext.openssl.ASN1$ASN1Data.toDER(ASN1.java:1422)
#        2: from org.jruby.ext.openssl.ASN1$ASN1Data.toASN1(ASN1.java:1381)
#        1: from org.jruby.ext.openssl.ASN1$ASN1Data.toASN1TaggedObject(ASN1.java:1406)
# Java::JavaLang::ClassCastException (org.jruby.RubyString cannot be cast to org.jruby.ext.openssl.ASN1$ASN1Data)

I guess something is missing here, where the RubyString, or Ruby primitive for that matter, must be first cast into the respective java object, before being passed down to .toASN1.

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