module Typhoeus::EasyFu::SSL
def self.included(base)
def self.included(base) base.extend(ClassMethods) end
def disable_ssl_host_verification
def disable_ssl_host_verification set_option(:verifyhost, 0) end
def disable_ssl_peer_verification
def disable_ssl_peer_verification set_option(:verifypeer, 0) end
def ssl_cacert=(cacert)
" File holding one or more certificates to verify the peer with. "
Set SSL CACERT
def ssl_cacert=(cacert) set_option(:cainfo, cacert) end
def ssl_capath=(capath)
" directory holding multiple CA certificates to verify the peer with. The certificate directory must be prepared using the openssl c_rehash utility. "
Set CAPATH
def ssl_capath=(capath) set_option(:capath, capath) end
def ssl_cert=(cert)
" The string should be the file name of your certificate. "
Set SSL certificate
def ssl_cert=(cert) set_option(:sslcert, cert) end
def ssl_cert_type=(cert_type)
Set SSL certificate type
def ssl_cert_type=(cert_type) raise "Invalid ssl cert type : '#{cert_type}'..." if cert_type and !%w(PEM DER p12).include?(cert_type) set_option(:sslcerttype, cert_type) end
def ssl_key=(key)
The default format is "PEM" and can be changed with ssl_key_type=
" The string should be the file name of your private key. "
Set SSL Key file
def ssl_key=(key) set_option(:sslkey, key) end
def ssl_key_password=(key_password)
def ssl_key_password=(key_password) set_option(:keypasswd, key_password) end
def ssl_key_type=(key_type)
" The string should be the format of your private key. Supported formats are "PEM", "DER" and "ENG". "
Set SSL Key type
def ssl_key_type=(key_type) raise "Invalid ssl key type : '#{key_type}'..." if key_type and !%w(PEM DER ENG).include?(key_type) set_option(:sslkeytype, key_type) end
def ssl_version
def ssl_version @ssl_version end
def ssl_version=(version)
def ssl_version=(version) raise "Invalid SSL version: '#{version}' supplied! Please supply one as listed in Typhoeus::Easy::SSL_VERSIONS" unless self.class.valid_ssl_version(version) @ssl_version = version set_option(:sslversion, Typhoeus::Easy::SSL_VERSIONS[version]) end