lib/airbrake/sender.rb in airbrake-3.0.8 vs lib/airbrake/sender.rb in airbrake-3.0.9
- old
+ new
@@ -1,9 +1,9 @@
module Airbrake
# Sends out the notice to Airbrake
class Sender
-
+
NOTICES_URI = '/notifier_api/v2/notices/'.freeze
HTTP_ERRORS = [Timeout::Error,
Errno::EINVAL,
Errno::ECONNRESET,
EOFError,
@@ -56,17 +56,10 @@
rescue => e
log :error, "[Airbrake::Sender#send_to_airbrake] Cannot send notification. Error: #{e.class} - #{e.message}\nBacktrace:\n#{e.backtrace.join("\n\t")}"
nil
end
-
- # Local certificate path.
- #
- def self.local_cert_path
- File.expand_path(File.join("..", "..", "..", "resources", "ca-bundle.crt"), __FILE__)
- end
-
attr_reader :proxy_host,
:proxy_port,
:proxy_user,
:proxy_pass,
:protocol,
@@ -105,15 +98,16 @@
http.open_timeout = http_open_timeout
if secure?
http.use_ssl = true
- if use_system_ssl_cert_chain? && File.exist?(OpenSSL::X509::DEFAULT_CERT_FILE)
- http.ca_file = OpenSSL::X509::DEFAULT_CERT_FILE
- else
- http.ca_file = Sender.local_cert_path # ca-bundle.crt built from source, see resources/README.md
- end
- http.verify_mode = OpenSSL::SSL::VERIFY_PEER
+ # if use_system_ssl_cert_chain? && File.exist?(OpenSSL::X509::DEFAULT_CERT_FILE)
+ # http.ca_file = OpenSSL::X509::DEFAULT_CERT_FILE
+ # else
+ # http.ca_file = Sender.local_cert_path # ca-bundle.crt built from source, see resources/README.md
+ # end
+ http.ca_file = Airbrake.configuration.ca_bundle_path
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
else
http.use_ssl = false
end
http