Sha256: 39be0b67698701e9ce49cbb036918e8b8f6f242ade1a78b530693a9fabc2fcf5

Contents?: true

Size: 908 Bytes

Versions: 46

Compression:

Stored size: 908 Bytes

Contents

require File.join( File.dirname(File.expand_path(__FILE__)), '../base')

describe RestClient::Request do
  describe "ssl verification" do
    it "is successful with the correct ca_file" do
      request = RestClient::Request.new(
        :method => :get,
        :url => 'https://www.mozilla.com',
        :verify_ssl => OpenSSL::SSL::VERIFY_PEER,
        :ssl_ca_file => File.join(File.dirname(__FILE__), "certs", "equifax.crt")
      )
      expect { request.execute }.to_not raise_error
    end

    it "is unsuccessful with an incorrect ca_file" do
      request = RestClient::Request.new(
        :method => :get,
        :url => 'https://www.mozilla.com',
        :verify_ssl => OpenSSL::SSL::VERIFY_PEER,
        :ssl_ca_file => File.join(File.dirname(__FILE__), "certs", "verisign.crt")
      )
      expect { request.execute }.to raise_error(RestClient::SSLCertificateNotVerified)
    end
  end
end

Version data entries

46 entries across 40 versions & 8 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/rest-client-1.6.7/spec/integration/request_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/rest-client-1.6.7/spec/integration/request_spec.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/rest-client-1.6.7/spec/integration/request_spec.rb
tdiary-5.0.8 vendor/bundle/gems/rest-client-1.6.7/spec/integration/request_spec.rb
rest-client_jxb_fix-1.6.7 spec/integration/request_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/rest-client-1.6.7/spec/integration/request_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/rest-client-1.6.7/spec/integration/request_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/rest-client-1.6.7/spec/integration/request_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/rest-client-1.6.7/spec/integration/request_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/rest-client-1.6.7/spec/integration/request_spec.rb
candlepin-api-0.4.0 bundle/ruby/gems/rest-client-1.6.7/spec/integration/request_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/rest-client-1.6.7/spec/integration/request_spec.rb
vulcan-0.8.2 server/vendor/gems/gems/rest-client-1.6.7/spec/integration/request_spec.rb
cft_smartcloud-0.3.3 lib/rest-client-1.6.6-master/spec/integration/request_spec.rb
vulcan-0.8.1 server/vendor/gems/gems/rest-client-1.6.7/spec/integration/request_spec.rb
vulcan-0.8.0 server/vendor/gems/gems/rest-client-1.6.7/spec/integration/request_spec.rb
vulcan-0.7.2 server/vendor/gems/gems/rest-client-1.6.7/spec/integration/request_spec.rb
vulcan-0.7.1 server/vendor/gems/gems/rest-client-1.6.7/spec/integration/request_spec.rb
vulcan-0.7.0 server/vendor/gems/gems/rest-client-1.6.7/spec/integration/request_spec.rb
vulcan-0.6.1 server/vendor/gems/gems/rest-client-1.6.7/spec/integration/request_spec.rb