def self.faf_request(path, content, content_type="application/json")
uri = URI.parse(Proxy::Abrt::Plugin.settings.server_url.to_s)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
if Proxy::Abrt::Plugin.settings.server_ssl_noverify
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
if Proxy::Abrt::Plugin.settings.server_ssl_cert && !Proxy::Abrt::Plugin.settings.server_ssl_cert.to_s.empty? \
&& Proxy::Abrt::Plugin.settings.server_ssl_key && !Proxy::Abrt::Plugin.settings.server_ssl_key.to_s.empty?
http.cert = OpenSSL::X509::Certificate.new(File.read(Proxy::Abrt::Plugin.settings.server_ssl_cert))
http.key = OpenSSL::PKey::RSA.new(File.read(Proxy::Abrt::Plugin.settings.server_ssl_key), nil)
end
headers, body = self.form_data_file content, content_type
path = [uri.path, path].join unless uri.path.empty?
response = http.start { |con| con.post(path, body, headers) }
response
end