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)
ext/openssl/lib/openssl/config.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/ext/openssl/lib/openssl/config.rb, line 292
def get_value(section, key)
if section.nil?
raise TypeError.new('nil not allowed')
end
section = 'default' if section.empty?
get_key_string(section, key)
end
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"