module RSpec::WebserviceMatchers::HaveAValidCert

Public Instance Methods

buggy_message?(text) click to toggle source
# File lib/rspec/webservice_matchers/have_a_valid_cert.rb, line 35
def buggy_message?(text)
  text =~ /Unable to verify|verify failed/
end
fix_for_excon_bug(error_message) click to toggle source

Excon is failing on SSL when a 302 (and possibly others) is received. We should be able to verify the SSL cert even though it's not a

  1. HTTPie and Curl are able to.

See github.com/excon/excon/issues/546

# File lib/rspec/webservice_matchers/have_a_valid_cert.rb, line 30
def fix_for_excon_bug(error_message)
  return error_message unless buggy_message?(error_message)
  'Unable to verify the certificate because a redirect was detected'
end