Class: PactBroker::BuildHttpOptions

Inherits:
Object
  • Object
show all
Extended by:
Services
Defined in:
lib/pact_broker/build_http_options.rb

Constant Summary

Constants included from Services

Services::SERVICE_FACTORIES

Class Method Summary collapse

Methods included from Services

badge_service, branch_service, certificate_service, contract_service, deployed_version_service, environment_service, get_service, group_service, index_service, integration_service, label_service, matrix_service, metrics_service, pact_service, pacticipant_service, register_default_services, register_service, released_version_service, tag_service, verification_service, version_service, webhook_service, webhook_trigger_service

Class Method Details

.call(uri, disable_ssl_verification: false, cert_store: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/pact_broker/build_http_options.rb', line 7

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