class OpenSSL::Config

def parse(string)

If the source of the IO is a file, then consider using #parse_config.

OpenSSL.
Parses a given _string_ as a blob that contains configuration for
#
def parse(string)
  c = new()
  parse_config(StringIO.new(string)).each do |section, hash|
    c.set_section(section, hash)
  end
  c
end