Sha256: f98826594b48e10a076fe5920534c7a41fe1e35ad116d508b78b4129a375fbd4

Contents?: true

Size: 1020 Bytes

Versions: 19

Compression:

Stored size: 1020 Bytes

Contents

module HTTParty
  module SSLTestHelper
    def ssl_verify_test(mode, ca_basename, server_cert_filename)
      test_server = nil
      begin
        # Start an HTTPS server
        test_server = SSLTestServer.new(
            :rsa_key => File.read(File.expand_path("../../fixtures/ssl/generated/server.key", __FILE__)),
            :cert => File.read(File.expand_path("../../fixtures/ssl/generated/#{server_cert_filename}", __FILE__)))
        test_server.start

        # Build a request
        if mode
          ca_path = File.expand_path("../../fixtures/ssl/generated/#{ca_basename}", __FILE__)
          raise ArgumentError.new("#{ca_path} does not exist") unless File.exist?(ca_path)
          return HTTParty.get("https://localhost:#{test_server.port}/", :format => :json, :timeout=>30, mode => ca_path)
        else
          return HTTParty.get("https://localhost:#{test_server.port}/", :format => :json, :timeout=>30)
        end
      ensure
        test_server.stop if test_server
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 5 rubygems

Version Path
httparty-0.8.2 spec/support/ssl_test_helper.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb
nutshell-crm-0.0.5 vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb
nutshell-crm-0.0.4 vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb
nutshell-crm-0.0.3 vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb
nutshell-crm-0.0.2 vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb
nutshell-crm-0.0.1 vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb
httparty-0.8.1 spec/support/ssl_test_helper.rb
httparty-0.8.0 spec/support/ssl_test_helper.rb
httparty2-0.7.10 spec/support/ssl_test_helper.rb
httparty-0.7.8 spec/support/ssl_test_helper.rb
httparty-0.7.7 spec/support/ssl_test_helper.rb
httparty-0.7.6 spec/support/ssl_test_helper.rb
httparty-0.7.4 spec/support/ssl_test_helper.rb
httparty-0.7.3 spec/support/ssl_test_helper.rb
httparty-0.7.2 spec/support/ssl_test_helper.rb
httparty-0.7.0 spec/support/ssl_test_helper.rb
dnclabs-httparty-0.6.1.2010090201 spec/support/ssl_test_helper.rb
bartzon-httparty-0.6.1 spec/support/ssl_test_helper.rb