Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OpenSSL::Config#get_value

get_value(section, key)

Gets the value of key from the given section

Given the following configurating file being loaded:

Example
config = OpenSSL::Config.load('foo.cnf')
  #=> #<OpenSSL::Config sections=["default"]>
puts config.to_s
  #=> [ default ]
  #   foo=bar

You can get a specific value from the config if you know the section and key like so:

Example
config.get_value('default','foo')
  #=> "bar"
See also #get_key_string #initialize_copy #each #inspect also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1