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#add_value
add_value(section, key, value)
ext/openssl/lib/openssl/config.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/ext/openssl/lib/openssl/config.rb, line 339
def add_value(section, key, value)
check_modify
(@data[section] ||= {})[key] = value
end
*Deprecated in v2.2.0*. This method will be removed in a future release.
Set the target key with a given value under a specific 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 set the value of foo under the default section to a new value:
Example
config.add_value('default', 'foo', 'buzz') #=> "buzz" puts config.to_s #=> [ default ] # foo=buzz