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#[]
[](section)
ext/openssl/lib/openssl/config.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/ext/openssl/lib/openssl/config.rb, line 360
def [](section)
@data[section] || {}
end
Get a specific section from the current configuration
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 hash of the specific section like so:
Example
config['default'] #=> {"foo"=>"bar"}
See also
#[]=
.unescape_value
.parse_config_lines
#add_value
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1