Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::SSL::SSLContext#set_params
(?untyped params) -> untyped
ctx.set_params(params = {}) → params
ext/openssl/lib/openssl/ssl.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/openssl/lib/openssl/ssl.rb, line 113
def set_params(params={})
params = DEFAULT_PARAMS.merge(params)
self.options |= params.delete(:options) # set before min_version/max_version
params.each{|name, value| self.__send__("#{name}=", value) }
if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
unless self.ca_file or self.ca_path or self.cert_store
if not defined?(Ractor) or Ractor.current == Ractor.main
self.cert_store = DEFAULT_CERT_STORE
else
self.cert_store = Ractor.current[:__openssl_default_store__] ||=
OpenSSL::X509::Store.new.tap { |store|
store.set_default_paths
}
end
end
end
return params
end
Sets saner defaults optimized for the use with HTTP-like protocols.
If a Hash params is given, the parameters are overridden with it. The keys in params must be assignment methods on SSLContext.
If the verify_mode is not VERIFY_NONE and ca_file, ca_path and cert_store are not set then the system default certificate store is used.
See also
#session_remove
#setup
#session_cache_stats
#sigalgs=
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0