Sha256: 8eab34f7fc4bcd77db21da50a1b808c671bb8e3a03b9c5006b235f0c2a797ed5

Contents?: true

Size: 565 Bytes

Versions: 26

Compression:

Stored size: 565 Bytes

Contents

require "pact_broker/services"

module PactBroker
  class BuildHttpOptions
    extend PactBroker::Services

    def self.call uri, disable_ssl_verification: false, cert_store: nil
      uri = URI(uri)
      options = {}

      if uri.scheme == "https"
        options[:use_ssl] = true
        options[:cert_store] = cert_store if cert_store
        if disable_ssl_verification
          options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE
        else
          options[:verify_mode] = OpenSSL::SSL::VERIFY_PEER
        end
      end
      options
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
pact_broker-2.112.0 lib/pact_broker/build_http_options.rb
pact_broker-2.111.0 lib/pact_broker/build_http_options.rb
pact_broker-2.109.1 lib/pact_broker/build_http_options.rb
pact_broker-2.109.0 lib/pact_broker/build_http_options.rb
pact_broker-2.108.0 lib/pact_broker/build_http_options.rb
pact_broker-2.107.1 lib/pact_broker/build_http_options.rb
pact_broker-2.107.0 lib/pact_broker/build_http_options.rb
pact_broker-2.107.0.beta.1 lib/pact_broker/build_http_options.rb
pact_broker-2.106.0 lib/pact_broker/build_http_options.rb
pact_broker-2.105.0 lib/pact_broker/build_http_options.rb
pact_broker-2.104.0 lib/pact_broker/build_http_options.rb
pact_broker-2.103.0 lib/pact_broker/build_http_options.rb
pact_broker-2.102.2 lib/pact_broker/build_http_options.rb
pact_broker-2.102.1 lib/pact_broker/build_http_options.rb
pact_broker-2.102.0 lib/pact_broker/build_http_options.rb
pact_broker-2.101.0 lib/pact_broker/build_http_options.rb
pact_broker-2.100.0 lib/pact_broker/build_http_options.rb
pact_broker-2.99.0 lib/pact_broker/build_http_options.rb
pact_broker-2.98.0 lib/pact_broker/build_http_options.rb
pact_broker-2.97.0 lib/pact_broker/build_http_options.rb