Sha256: 36c5c787a458e5c1662327faf3b5915d4983f886b26624330d07913fdb553a0e

Contents?: true

Size: 906 Bytes

Versions: 17

Compression:

Stored size: 906 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.google.com',
        :verify_ssl => OpenSSL::SSL::VERIFY_PEER,
        :ssl_ca_file => File.join(File.dirname(__FILE__), "certs", "verisign.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.google.com',
        :verify_ssl => OpenSSL::SSL::VERIFY_PEER,
        :ssl_ca_file => File.join(File.dirname(__FILE__), "certs", "equifax.crt")
      )
      expect { request.execute }.to raise_error(RestClient::SSLCertificateNotVerified)
    end
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
rest-client-1.6.3 spec/integration/request_spec.rb
larsburgess-rest-client-1.6.1 spec/integration/request_spec.rb
rest-client-1.6.2.a spec/integration/request_spec.rb
rest-client-next-dshelf-1.6.1 spec/integration/request_spec.rb
gemrage-1.0.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.4.1 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.4.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.3.2 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.3.1 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.3.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.2.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.1.2 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.1.1 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.1.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
gemrage-0.0.0 vendor/ruby/1.8/gems/rest-client-1.6.1/spec/integration/request_spec.rb
rest-client-1.6.1 spec/integration/request_spec.rb
rest-client-1.6.1.a spec/integration/request_spec.rb