Method: OpenSSL::SSL::SSLContext#set_params
- Defined in:
- lib/openssl/ssl.rb
#set_params(params = {}) ⇒ Object
call-seq:
ctx.set_params(params = {}) -> params
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.
139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/openssl/ssl.rb', line 139 def set_params(params={}) params = DEFAULT_PARAMS.merge(params) self. = 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 self.cert_store = DEFAULT_CERT_STORE end end return params end |