Exception: Excon::Errors::CertificateError

Inherits:
SocketError show all
Defined in:
lib/excon/errors.rb

Instance Attribute Summary

Attributes inherited from SocketError

#socket_error

Instance Method Summary collapse

Constructor Details

#initialize(socket_error = Excon::Errors::Error.new) ⇒ CertificateError

Returns a new instance of CertificateError.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/excon/errors.rb', line 23

def initialize(socket_error = Excon::Errors::Error.new)
  msg = "Unable to verify certificate. This may be an issue with the remote host or with Excon." +
        "Excon has certificates bundled, but these can be customized." +
        "`Excon.defaults[:ssl_ca_path] = path_to_certs`, " +
        "`ENV['SSL_CERT_DIR'] = path_to_certs`, " +
        "`Excon.defaults[:ssl_ca_file] = path_to_file`, " +
        "`ENV['SSL_CERT_FILE'] = path_to_file`, " +
        "`Excon.defaults[:ssl_verify_callback] = callback` (see OpenSSL::SSL::SSLContext#verify_callback), or " +
        "`Excon.defaults[:ssl_verify_peer] = false` (less secure)."
  full_message = "#{socket_error.message} (#{socket_error.class})" + ' ' + msg
  super(full_message)
  set_backtrace(socket_error.backtrace)
  @socket_error = socket_error
end