jruby-openssl icon indicating copy to clipboard operation
jruby-openssl copied to clipboard

Making parse_config accepts a String like Ruby MRI

Open edipofederle opened this issue 1 year ago • 3 comments

With Ruby MRI, we can do:

OpenSSL::Config.parse_config("") # also accepts a String

but not with JRuby:

NoMethodError: undefined method `lineno' for "":String
   Did you mean?  lines

edipofederle avatar May 20 '24 14:05 edipofederle

@kares maybe we can take a quick look into this one? thanks

edipofederle avatar May 28 '24 11:05 edipofederle

Seems like this is ready to go?

headius avatar Jun 17 '24 21:06 headius

did look into this but did not figure out a path fwd. the logic isn't matching what MRI is doing (in native C)...

  • parse isn't calling parse_config (we're a bit convoluted here parse -> parse_config -> parse)
  • check is done on having an IO-like (gets ugly with JRuby) and everything else is considered io.to_str

@headius but if it looks good to you, feel free to merge. I usually "Squash and merge" small change-sets (easier to dig out history) but if you have a different preference it's fine

kares avatar Jun 18 '24 13:06 kares