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.96.0 lib/pact_broker/build_http_options.rb
pact_broker-2.95.1 lib/pact_broker/build_http_options.rb
pact_broker-2.95.0 lib/pact_broker/build_http_options.rb
pact_broker-2.94.0 lib/pact_broker/build_http_options.rb
pact_broker-2.93.4 lib/pact_broker/build_http_options.rb
pact_broker-2.93.3 lib/pact_broker/build_http_options.rb