Class: Hurley::SslOptions

Inherits:
Struct
  • Object
show all
Defined in:
lib/hurley/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ca_fileObject

Returns the value of attribute ca_file

Returns:

  • (Object)

    the current value of ca_file



60
61
62
# File 'lib/hurley/options.rb', line 60

def ca_file
  @ca_file
end

#ca_pathObject

Returns the value of attribute ca_path

Returns:

  • (Object)

    the current value of ca_path



60
61
62
# File 'lib/hurley/options.rb', line 60

def ca_path
  @ca_path
end

#client_certObject

Returns the value of attribute client_cert

Returns:

  • (Object)

    the current value of client_cert



60
61
62
# File 'lib/hurley/options.rb', line 60

def client_cert
  @client_cert
end

#client_cert_pathObject

Returns the value of attribute client_cert_path

Returns:

  • (Object)

    the current value of client_cert_path



60
61
62
# File 'lib/hurley/options.rb', line 60

def client_cert_path
  @client_cert_path
end

#openssl_cert_storeObject

Returns the value of attribute openssl_cert_store

Returns:

  • (Object)

    the current value of openssl_cert_store



60
61
62
# File 'lib/hurley/options.rb', line 60

def openssl_cert_store
  @openssl_cert_store
end

#openssl_client_certObject

Returns the value of attribute openssl_client_cert

Returns:

  • (Object)

    the current value of openssl_client_cert



60
61
62
# File 'lib/hurley/options.rb', line 60

def openssl_client_cert
  @openssl_client_cert
end

#openssl_client_keyObject

Returns the value of attribute openssl_client_key

Returns:

  • (Object)

    the current value of openssl_client_key



60
61
62
# File 'lib/hurley/options.rb', line 60

def openssl_client_key
  @openssl_client_key
end

#private_keyObject

Returns the value of attribute private_key

Returns:

  • (Object)

    the current value of private_key



60
61
62
# File 'lib/hurley/options.rb', line 60

def private_key
  @private_key
end

#private_key_passObject

Returns the value of attribute private_key_pass

Returns:

  • (Object)

    the current value of private_key_pass



60
61
62
# File 'lib/hurley/options.rb', line 60

def private_key_pass
  @private_key_pass
end

#private_key_pathObject

Returns the value of attribute private_key_path

Returns:

  • (Object)

    the current value of private_key_path



60
61
62
# File 'lib/hurley/options.rb', line 60

def private_key_path
  @private_key_path
end

#skip_verificationObject

Returns the value of attribute skip_verification

Returns:

  • (Object)

    the current value of skip_verification



60
61
62
# File 'lib/hurley/options.rb', line 60

def skip_verification
  @skip_verification
end

#verify_depthObject

Returns the value of attribute verify_depth

Returns:

  • (Object)

    the current value of verify_depth



60
61
62
# File 'lib/hurley/options.rb', line 60

def verify_depth
  @verify_depth
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



60
61
62
# File 'lib/hurley/options.rb', line 60

def version
  @version
end

Instance Method Details

#openssl_private_keyObject



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/hurley/options.rb', line 124

def openssl_private_key
  @openssl_private_key ||= begin
    pkey = if pkey_path = self[:private_key_path]
      File.read(pkey_path)
    else
      self[:private_key]
    end

    return unless pkey

    if OpenSSL::PKey.respond_to?(:read)
      OpenSSL::PKey.read(pkey, self[:private_key_pass])
    else
      OpenSSL::PKey::RSA.new(pkey, self[:private_key_pass])
    end
  end
end

#openssl_verify_modeObject



106
107
108
# File 'lib/hurley/options.rb', line 106

def openssl_verify_mode
  skip_verification ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
end

#skip_verification?Boolean

Returns:

  • (Boolean)


102
103
104
# File 'lib/hurley/options.rb', line 102

def skip_verification?
  self[:skip_verification]
end