Class: OpenSSL::SSL::SSLContext

Inherits:
Object
  • Object
show all
Defined in:
lib/extensions/openssl/openssl/ssl-internal.rb

Constant Summary collapse

DEFAULT_PARAMS =
{
  :ssl_version => "SSLv23",
  :verify_mode => OpenSSL::SSL::VERIFY_PEER,
  :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
  :options => OpenSSL::SSL::OP_ALL,
}
DEFAULT_CERT_STORE =
OpenSSL::X509::Store.new

Instance Method Summary collapse

Instance Method Details

#set_params(params = {}) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 35

def set_params(params={})
  params = DEFAULT_PARAMS.merge(params)
  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