Class: PactBroker::BuildHttpOptions
- Inherits:
-
Object
- Object
- PactBroker::BuildHttpOptions
show all
- Extended by:
- Services
- Defined in:
- lib/pact_broker/build_http_options.rb
Class Method Summary
collapse
Methods included from Services
badge_service, certificate_service, group_service, index_service, label_service, matrix_service, pact_service, pacticipant_service, tag_service, verification_service, version_service, webhook_service
Class Method Details
.call(uri) ⇒ 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
uri = URI(uri)
options = {}
if uri.scheme == 'https'
options[:use_ssl] = true
options[:cert_store] = 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
|
.cert_store ⇒ Object
27
28
29
|
# File 'lib/pact_broker/build_http_options.rb', line 27
def self.cert_store
certificate_service.cert_store
end
|
.disable_ssl_verification? ⇒ Boolean
23
24
25
|
# File 'lib/pact_broker/build_http_options.rb', line 23
def self.disable_ssl_verification?
PactBroker.configuration.disable_ssl_verification
end
|