pact-foundation / pact-ruby

Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://pact.io
MIT License
2.17k stars 215 forks source link

Let's Encrypt certificate verify failed September 30th #248

Closed mkj28 closed 2 years ago

mkj28 commented 3 years ago

This might be a better location for pact-1.59.0 issue part of https://github.com/pact-foundation/pact-ruby-standalone/issues/69

With https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/ seeing following (replaced our actual host with host.with.letsencrypt.cert.com):

STDERR:
opening connection to host.with.letsencrypt.cert.com:443...
opened
starting SSL for host.with.letsencrypt.cert.com:443...
SSL established
Conn close because of connect error SSL_connect returned=1 errno=0 state=error: certificate verify failed
Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 1 of 3
opening connection to host.with.letsencrypt.cert.com:443...
opened
starting SSL for host.with.letsencrypt.cert.com:443...
SSL established
Conn close because of connect error SSL_connect returned=1 errno=0 state=error: certificate verify failed
Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 2 of 3
opening connection to host.with.letsencrypt.cert.com:443...
opened
starting SSL for host.with.letsencrypt.cert.com:443...
SSL established
Conn close because of connect error SSL_connect returned=1 errno=0 state=error: certificate verify failed
Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 3 of 3
/opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError)
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect'
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:852:in `start'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/hal/http_client.rb:55:in `block in perform_request'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/retry.rb:23:in `until_****'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/hal/http_client.rb:49:in `perform_request'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/hal/http_client.rb:24:in `get'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/hal/link.rb:49:in `get'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:54:in `index'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:39:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:35:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0/lib/pact/pact_broker.rb:18:in `fetch_pact_uris_for_verification'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:46:in `pacts_for_verification'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:39:in `pacts_urls_from_broker'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:26:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:10:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/app.rb:207:in `all_pact_urls'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/app.rb:221:in `warn_empty_pact_set'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/app.rb:40:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/app.rb:35:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/cli/verify.rb:49:in `verify'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'
 from /opt/pact/lib/app/pact-provider-verifier.rb:33:in `
bethesque commented 3 years ago

Oh, are you using the native gem? I thought you were on the standalone. I'll need to add support to the native gem directly. Should be able to get it out asap.

mkj28 commented 3 years ago

Oh, are you using the native gem? I thought you were on the standalone. I'll need to add support to the native gem directly. Should be able to get it out asap.

we have a mix in various repos - tbh not even 100% sure how's this exactly installed in the dependency chain, but if you'll have a working version I can try upgrading by hand

mkj28 commented 3 years ago

we have a mix in various repos - tbh not even 100% sure how's this exactly installed in the dependency chain, but if you'll have a working version I can try upgrading by hand

ok so for us it comes from https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.72/pact-1.88.72-linux-x86_64.tar.gz:/pact/lib/vendor/ruby/2.2.0/gems/pact-1.59.0

bethesque commented 3 years ago

I'm not 100% sure I've got everywhere, but try updating to pact 1.60.0 with PACT_DISABLE_SSL_VERIFICATION=true and see if that works. There will be a new version of the pact gem and the pact-support gem.

mkj28 commented 3 years ago

I'm not 100% sure I've got everywhere, but try updating to pact 1.60.0 with PACT_DISABLE_SSL_VERIFICATION =true and see if that works. There will be a new version of the pact gem and the pact-support gem.

On it! Will report back in about 20 minutes or so.

mkj28 commented 3 years ago

Unfortunately in our case the manually installed version did not get picked up - I still see the 1.59 being used from the standalone package: https://github.com/pact-foundation/pact-ruby-standalone/issues/69#issuecomment-931944017

I think we'll need a new standalone release with 1.60, v1.88.73 still carries 1.59

mkj28 commented 3 years ago

trying standalone 1.88.74 now

mkj28 commented 3 years ago

1.60 still not going through (Ill run with verbose next, if it helps):

STDERR:
Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 1 of 3
Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 2 of 3
Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 3 of 3
/opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError)
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect'
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
 from /opt/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:852:in `start'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/hal/http_client.rb:62:in `block in perform_request'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/retry.rb:23:in `until_****'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/hal/http_client.rb:50:in `perform_request'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/hal/http_client.rb:25:in `get'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/hal/link.rb:49:in `get'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:54:in `index'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:39:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:35:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-1.60.0/lib/pact/pact_broker.rb:18:in `fetch_pact_uris_for_verification'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:46:in `pacts_for_verification'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:39:in `pacts_urls_from_broker'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:26:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/aggregate_pact_configs.rb:10:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/app.rb:207:in `all_pact_urls'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/app.rb:221:in `warn_empty_pact_set'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/app.rb:40:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/app.rb:35:in `call'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/cli/verify.rb:49:in `verify'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
 from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.36.0/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'
 from /opt/pact/lib/app/pact-provider-verifier.rb:33:in `
bethesque commented 3 years ago

Did you set the env var?

          if disable_ssl_verification?
            if verbose?
              Pact.configuration.output_stream.puts("SSL verification is disabled")
            end
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE
          end
          http.start do |http|     # this is where the error is being raised
            http.request request
          end

You should be seeing "SSL verification is disabled" in the output.

bethesque commented 3 years ago

I haven't fixed the real problem, I've only made it respond to PACT_DISABLE_SSL_VERIFICATION=true

mkj28 commented 3 years ago

I haven't fixed the real problem, I've only made it respond to PACT_DISABLE_SSL_VERIFICATION=true

yeah, not seeing the expected "SSL verification is disabled" in the output (once I ran with VERBOSE=true), debugging on my side, I think I did set the env variables correctly... will report back soon

bethesque commented 3 years ago

This is what I'm seeing with a local test.

pact $ VERBOSE=true PACT_DISABLE_SSL_VERIFICATION=true be rake pact:verify:foobar_using_broker
/Users/bethanyskurrie/.rubies/ruby-2.7.2/bin/ruby -I/Users/bethanyskurrie/.gem/ruby/2.7.2/gems/rspec-core-3.10.1/lib:/Users/bethanyskurrie/.gem/ruby/2.7.2/gems/rspec-support-3.10.2/lib /Users/bethanyskurrie/.gem/ruby/2.7.2/gems/rspec-core-3.10.1/exe/rspec spec/features/foo_bar_spec.rb
Run options: exclude {:skip_jruby=>false}

Bar
  can retrieve a thing

Finished in 0.13517 seconds (files took 0.84216 seconds to load)
1 example, 0 failures

SPEC_OPTS='' /Users/bethanyskurrie/.rubies/ruby-2.7.2/bin/ruby -S pact verify --pact-helper ./spec/support/bar_pact_helper.rb
SSL verification is disabled
opening connection to localhost:9292...
opened
<- "GET / HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nHost: localhost:9292\r\n\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 4019\r\n"
-> "Date: Fri, 01 Oct 2021 06:54:35 GMT\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.86.0\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Connection: Keep-Alive\r\n"
-> "\r\n"
reading 4019 bytes...
-> "{\"_links\":{\"self\":{\"href\":\"http://localhost:9292\",\"title\":\"Index\",\"templated\":false},\"pb:publish-pact\":{\"href\":\"http://localhost:9292/pacts/provider/{provider}/consumer/{consumer}/version/{consumerApplicationVersion}\",\"title\":\"Publish a pact\",\"templated\":true},\"pb:publish-contracts\":{\"href\":\"http://localhost:9292/contracts/publish\",\"title\":\"Publish contracts\",\"templated\":false},\"pb:latest-pact-versions\":{\"href\":\"http://localhost:9292/pacts/latest\",\"title\":\"Latest pact versions\",\"templated\":false},\"pb:tagged-pact-versions\":{\"href\":\"http://localhost:9292/pacts/provider/{provider}/consumer/{consumer}/tag/{tag}\",\"title\":\"All versions of a pact for a given consumer, provider and consumer version tag\",\"templated\":false},\"pb:pacticipants\":{\"href\":\"http://localhost:9292/pacticipants\",\"title\":\"Pacticipants\",\"templated\":false},\"pb:pacticipant\":{\"href\":\"http://localhost:9292/pacticipants/{pacticipant}\",\"title\":\"Fetch pacticipant by name\",\"templated\":true},\"pb:latest-provider-pacts\":{\"href\":\"http://localhost:9292/pacts/provider/{provider}/latest\",\"title\":\"Latest pacts by provider\",\"templated\":true},\"pb:latest-provider-pacts-with-tag\":{\"href\":\"http://localhost:9292/pacts/provider/{provider}/latest/{tag}\",\"title\":\"Latest pacts for provider with the specified tag\",\"templated\":true},\"pb:provider-pacts-with-tag\":{\"href\":\"http://localhost:9292/pacts/provider/{provider}/tag/{tag}\",\"title\":\"All pact versions for the provider with the specified consumer version tag\",\"templated\":true},\"pb:provider-pacts\":{\"href\":\"http://localhost:9292/pacts/provider/{provider}\",\"title\":\"All pact versions for the specified provider\",\"templated\":true},\"pb:latest-version\":{\"href\":\"http://localhost:9292/pacticipants/{pacticipant}/latest-version\",\"title\":\"Latest pacticipant version\",\"templated\":true},\"pb:latest-tagged-version\":{\"href\":\"http://localhost:9292/pacticipants/{pacticipant}/latest-version/{tag}\",\"title\":\"Latest pacticipant version with the specified tag\",\"templated\":true},\"pb:webhooks\":{\"href\":\"http://localhost:9292/webhooks\",\"title\":\"Webhooks\",\"templated\":false},\"pb:webhook\":{\"href\":\"http://localhost:9292/webhooks/{uuid}\",\"title\":\"Webhook\",\"templated\":true},\"pb:integrations\":{\"href\":\"http://localhost:9292/integrations\",\"title\":\"Integrations\",\"templated\":false},\"pb:pacticipant-version-tag\":{\"href\":\"http://localhost:9292/pacticipants/{pacticipant}/versions/{version}/tags/{tag}\",\"title\":\"Get, create or delete a tag for a pacticipant version\",\"templated\":true},\"pb:pacticipant-branch-version\":{\"href\":\"http://localhost:9292/pacticipants/{pacticipant}/branches/{branch}/versions/{version}\",\"title\":\"Get or add/create a pacticipant version for a branch\",\"templated\":true},\"pb:pacticipant-version\":{\"href\":\"http://localhost:9292/pacticipants/{pacticipant}/versions/{version}\",\"title\":\"Get, create or delete a pacticipant version\",\"templated\":true},\"pb:metrics\":{\"href\":\"http://localhost:9292/metrics\",\"title\":\"Get Pact Broker metrics\"},\"pb:can-i-deploy-pacticipant-version-to-tag\":{\"href\":\"http://localhost:9292/can-i-deploy?pacticipant={pacticipant}&version={version}&to={tag}\",\"title\":\"Determine if an application can be safely deployed to an environment identified by the given tag\",\"templated\":true},\"pb:provider-pacts-for-verification\":{\"href\":\"http://localhost:9292/pacts/provider/{provider}/for-verification\",\"title\":\"Pact versions to be verified for the specified provider\",\"templated\":true},\"beta:provider-pacts-for-verification\":{\"name\":\"beta\",\"href\":\"http://localhost:9292/pacts/provider/{provider}/for-verification\",\"title\":\"DEPRECATED - please use pb:provider-pacts-for-verification\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"http://localhost:9292/doc/{rel}?context=index\",\"templated\":true},{\"name\":\"beta\",\"href\":\"http://localhost:9292/doc/{rel}?context=index\",\"templated\":true}],\"pb:environments\":{\"title\":\"Environments\",\"href\":\"http://localhost:9292/environments\",\"templated\":false},\"pb:environment\":{\"title\":\"Environment\",\"href\":\"http://localhost:9292/environments/{uuid}\",\"templated\":true}}}"
read 4019 bytes
Conn keep-alive
INFO: Fetching pacts for Bar from http://localhost:9292 with the selection criteria: latest for tag prod
SSL verification is disabled
opening connection to localhost:9292...
opened
<- "POST /pacts/provider/Bar/for-verification HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nHost: localhost:9292\r\nContent-Length: 125\r\n\r\n"
<- "{\"consumerVersionSelectors\":[{\"tag\":\"prod\",\"latest\":true}],\"providerVersionTags\":[\"master\"],\"providerVersionBranch\":\"master\"}"
-> "HTTP/1.1 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 1028\r\n"
-> "Date: Fri, 01 Oct 2021 06:54:35 GMT\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.86.0\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Connection: Keep-Alive\r\n"
-> "\r\n"
reading 1028 bytes...
-> "{\"_embedded\":{\"pacts\":[{\"shortDescription\":\"latest with tag prod\",\"verificationProperties\":{\"pending\":false,\"notices\":[{\"when\":\"before_verification\",\"text\":\"The pact at http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a is being verified because the pact content belongs to the consumer version matching the following criterion:\\n    * latest version tagged 'prod' (1.0.0)\"},{\"when\":\"before_verification\",\"text\":\"This pact has previously been successfully verified by a version of Bar with tag 'master'. If this verification fails, it will fail the build. Read more at https://docs.pact.io/go/pending\"}]},\"_links\":{\"self\":{\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/metadata/c1tdW3RdPXByb2Qmc1tdW2xdPXRydWUmc1tdW2N2XT02MCZwPWZhbHNl\",\"name\":\"Pact between Foo (1.0.0) and Bar\"}}}]},\"_links\":{\"self\":{\"href\":\"http://localhost:9292/pacts/provider/Bar/for-verification\",\"title\":\"Pacts to be verified\"}}}"
read 1028 bytes
Conn keep-alive
SSL verification is disabled
opening connection to localhost:9292...
opened
<- "GET /pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/metadata/c1tdW3RdPXByb2Qmc1tdW2xdPXRydWUmc1tdW2N2XT02MCZwPWZhbHNl HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: localhost:9292\r\n\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 3834\r\n"
-> "Date: Fri, 01 Oct 2021 06:54:35 GMT\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.86.0\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Connection: Keep-Alive\r\n"
-> "\r\n"
reading 3834 bytes...
-> "{\"consumer\":{\"name\":\"Foo\"},\"provider\":{\"name\":\"Bar\"},\"interactions\":[{\"_id\":\"95646c92e2d04419c9929b5c5adff01a0530cf1f\",\"description\":\"a retrieve thing request\",\"request\":{\"method\":\"get\",\"path\":\"/thing\"},\"response\":{\"status\":200,\"headers\":{\"Content-Type\":\"application/json\"},\"body\":{\"name\":\"Thing 1\"}}}],\"metadata\":{\"pactSpecification\":{\"version\":\"2.0.0\"}},\"createdAt\":\"2021-10-01T05:51:13+00:00\",\"_links\":{\"self\":{\"title\":\"Pact\",\"name\":\"Pact between Foo (1.0.0) and Bar\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/version/1.0.0\"},\"pb:consumer\":{\"title\":\"Consumer\",\"name\":\"Foo\",\"href\":\"http://localhost:9292/pacticipants/Foo\"},\"pb:consumer-version\":{\"title\":\"Consumer version\",\"name\":\"1.0.0\",\"href\":\"http://localhost:9292/pacticipants/Foo/versions/1.0.0\"},\"pb:provider\":{\"title\":\"Provider\",\"name\":\"Bar\",\"href\":\"http://localhost:9292/pacticipants/Bar\"},\"pb:pact-version\":{\"title\":\"Pact content version permalink\",\"name\":\"0e3369199f4008231946e0245474537443ccda2a\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a\"},\"pb:latest-pact-version\":{\"title\":\"Latest version of this pact\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/latest\"},\"pb:all-pact-versions\":{\"title\":\"All versions of this pact\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/versions\"},\"pb:latest-untagged-pact-version\":{\"title\":\"Latest untagged version of this pact\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/latest-untagged\"},\"pb:latest-tagged-pact-version\":{\"title\":\"Latest tagged version of this pact\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/latest/{tag}\",\"templated\":true},\"pb:previous-distinct\":{\"title\":\"Previous distinct version of this pact\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/version/1.0.0/previous-distinct\"},\"pb:diff-previous-distinct\":{\"title\":\"Diff with previous distinct version of this pact\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/version/1.0.0/diff/previous-distinct\"},\"pb:diff\":{\"title\":\"Diff with another specified version of this pact\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/diff/pact-version/{pactVersion}\",\"templated\":true},\"pb:pact-webhooks\":{\"title\":\"Webhooks for the pact between Foo and Bar\",\"href\":\"http://localhost:9292/webhooks/provider/Bar/consumer/Foo\"},\"pb:consumer-webhooks\":{\"title\":\"Webhooks for all pacts with provider Bar\",\"href\":\"http://localhost:9292/webhooks/consumer/Bar\"},\"pb:tag-prod-version\":{\"title\":\"PUT to this resource to tag this consumer version as 'production'\",\"href\":\"http://localhost:9292/pacticipants/Foo/versions/1.0.0/tags/prod\"},\"pb:tag-version\":{\"title\":\"PUT to this resource to tag this consumer version\",\"href\":\"http://localhost:9292/pacticipants/Foo/versions/1.0.0/tags/{tag}\"},\"pb:publish-verification-results\":{\"title\":\"Publish verification results\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/metadata/c1tdW3RdPXByb2Qmc1tdW2xdPXRydWUmc1tdW2N2XT02MCZwPWZhbHNl/verification-results\"},\"pb:latest-verification-results\":{\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/verification-results/latest\"},\"pb:triggered-webhooks\":{\"title\":\"Webhooks triggered by the publication of this pact\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/version/1.0.0/triggered-webhooks\"},\"pb:matrix-for-consumer-version\":{\"title\":\"View matrix rows for the consumer version to which this pact belongs\",\"href\":\"http://localhost:9292/matrix?q[][pacticipant]=Foo&q[][version]=1.0.0&latestby=cvpv\"},\"curies\":[{\"name\":\"pb\",\"href\":\"http://localhost:9292/doc/{rel}?context=pact\",\"templated\":true}]}}"
read 3834 bytes
Conn keep-alive
INFO: Reading pact at ./spec/pacts/foo-bar.json
INFO: Reading pact at http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/metadata/c1tdW3RdPXByb2Qmc1tdW2xdPXRydWUmc1tdW2N2XT02MCZwPWZhbHNl

Verifying a pact between Foo and Bar
  A retrieve thing request
    with GET /thing
      returns a response which
        has status code 200
        has a matching body
        includes headers
          "Content-Type" which equals "application/json"

DEBUG: The pact at http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a is being verified because the pact content belongs to the consumer version matching the following criterion:
    * latest version tagged 'prod' (1.0.0)
DEBUG: This pact has previously been successfully verified by a version of Bar with tag 'master'. If this verification fails, it will fail the build. Read more at https://docs.pact.io/go/pending

Verifying a pact between Foo and Bar
  A retrieve thing request
    with GET /thing
      returns a response which
        has status code 200
        has a matching body
        includes headers
          "Content-Type" which equals "application/json"
SSL verification is disabled
opening connection to localhost:9292...
opened
<- "GET /pacts/provider/Bar/consumer/Foo/version/1.0.0/diff/previous-distinct HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: text/plain\r\nUser-Agent: Ruby\r\nHost: localhost:9292\r\n\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "Content-Type: text/plain;charset=utf-8\r\n"
-> "Content-Length: 838\r\n"
-> "Date: Fri, 01 Oct 2021 06:54:35 GMT\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.86.0\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Connection: Keep-Alive\r\n"
-> "\r\n"
reading 838 bytes...
-> "# Diff between versions 2 and 1.0.0 of the pact between Foo and Bar\n\nThe following changes were made about 1 hour ago (Fri 01 Oct 2021, 3:51pm +10:00)\n\n {\n   \"interactions\": [\n     {\n-      \"_id\": \"027ce22b83b3a551c2f39593a05f8101f59a33f1\",\n-      \"description\": \"a request\",\n+      \"_id\": \"95646c92e2d04419c9929b5c5adff01a0530cf1f\",\n+      \"description\": \"a retrieve thing request\",\n       \"request\": {\n-        \"method\": \"GET\",\n-        \"path\": \"/things/111\"\n+        \"method\": \"get\",\n+        \"path\": \"/thing\"\n       }\n     }\n   ]\n\n## Links\n\npact-version:\n  title: Pact\n  name: Pact between Foo (1.0.0) and Bar\n  href: http://localhost:9292/pacts/provider/Bar/consumer/Foo/version/1.0.0\ncomparison-pact-version:\n  title: Pact\n  name: Pact between Foo (2) and Bar\n  href: http://localhost:9292/pacts/provider/Bar/consumer/Foo/version/2\n"
read 838 bytes
Conn keep-alive

2 interactions, 0 failures
WARN: Cannot publish verification for Foo as there is no link named pb:publish-verification-results in the pact JSON. If you are using a pact broker, please upgrade to version 2.0.0 or later.
SSL verification is disabled
opening connection to localhost:9292...
opened
<- "GET /pacticipants/Bar HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nHost: localhost:9292\r\n\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 1744\r\n"
-> "Date: Fri, 01 Oct 2021 06:54:35 GMT\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.86.0\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Connection: Keep-Alive\r\n"
-> "\r\n"
reading 1744 bytes...
-> "{\"name\":\"Bar\",\"displayName\":\"Bar\",\"mainBranch\":\"main\",\"updatedAt\":\"2021-10-01T03:54:22+00:00\",\"createdAt\":\"2021-10-01T03:54:22+00:00\",\"_embedded\":{\"latestVersion\":{\"number\":\"1.2.3\",\"_links\":{\"self\":{\"title\":\"Version\",\"name\":\"1.2.3\",\"href\":\"http://localhost:9292/pacticipants/Bar/versions/1.2.3\"}}},\"labels\":[],\"latest-version\":{\"number\":\"1.2.3\",\"_links\":{\"self\":{\"title\":\"Version\",\"name\":\"1.2.3\",\"href\":\"http://localhost:9292/pacticipants/Bar/versions/1.2.3\"}},\"title\":\"DEPRECATED - please use latestVersion\",\"name\":\"DEPRECATED - please use latestVersion\"}},\"_links\":{\"self\":{\"href\":\"http://localhost:9292/pacticipants/Bar\"},\"pb:versions\":{\"href\":\"http://localhost:9292/pacticipants/Bar/versions\"},\"pb:version\":{\"title\":\"Get, create or delete a pacticipant version\",\"href\":\"http://localhost:9292/pacticipants/Bar/versions/{version}\",\"templated\":true},\"pb:version-tag\":{\"title\":\"Get, create or delete a tag for a version of Bar\",\"href\":\"http://localhost:9292/pacticipants/Bar/versions/{version}/tags/{tag}\",\"templated\":true},\"pb:branch-version\":{\"title\":\"Get or add/create a version for a branch of Bar\",\"href\":\"http://localhost:9292/pacticipants/Bar/branches/{branch}/versions/{version}\",\"templated\":true},\"pb:label\":{\"title\":\"Get, create or delete a label for Bar\",\"href\":\"http://localhost:9292/pacticipants/Bar/labels/{label}\",\"templated\":true},\"versions\":{\"title\":\"Deprecated - use pb:versions\",\"href\":\"http://localhost:9292/pacticipants/Bar/versions\"},\"pb:can-i-deploy-badge\":{\"title\":\"Can I Deploy Bar badge\",\"href\":\"http://localhost:9292/pacticipants/Bar/latest-version/{tag}/can-i-deploy/to/{environmentTag}/badge\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"http://localhost:9292/doc/{rel}?context=pacticipant\",\"templated\":true}]}}"
read 1744 bytes
Conn keep-alive
INFO: Creating Bar version 1.2.3 with branch "master"
SSL verification is disabled
opening connection to localhost:9292...
opened
<- "PUT /pacticipants/Bar/branches/master/versions/1.2.3 HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nHost: localhost:9292\r\nContent-Length: 0\r\n\r\n"
<- ""
-> "HTTP/1.1 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 205\r\n"
-> "Date: Fri, 01 Oct 2021 06:54:35 GMT\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.86.0\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Connection: Keep-Alive\r\n"
-> "\r\n"
reading 205 bytes...
-> "{\"updatedAt\":\"2021-10-01T06:54:35+00:00\",\"createdAt\":\"2021-10-01T05:51:14+00:00\",\"_links\":{\"self\":{\"title\":\"Branch version\",\"href\":\"http://localhost:9292/pacticipants/Bar/branches/master/versions/1.2.3\"}}}"
read 205 bytes
Conn keep-alive
INFO: Tagging version 1.2.3 of Bar as "master"
SSL verification is disabled
opening connection to localhost:9292...
opened
<- "PUT /pacticipants/Bar/versions/1.2.3/tags/master HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nHost: localhost:9292\r\nContent-Length: 0\r\n\r\n"
<- ""
-> "HTTP/1.1 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 389\r\n"
-> "Date: Fri, 01 Oct 2021 06:54:35 GMT\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.86.0\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Connection: Keep-Alive\r\n"
-> "\r\n"
reading 389 bytes...
-> "{\"name\":\"master\",\"createdAt\":\"2021-10-01T05:51:14+00:00\",\"_links\":{\"self\":{\"title\":\"Tag\",\"name\":\"master\",\"href\":\"http://localhost:9292/pacticipants/Bar/versions/1.2.3/tags/master\"},\"version\":{\"title\":\"Version\",\"name\":\"1.2.3\",\"href\":\"http://localhost:9292/pacticipants/Bar/versions/1.2.3\"},\"pacticipant\":{\"title\":\"Pacticipant\",\"name\":\"Bar\",\"href\":\"http://localhost:9292/pacticipants/Bar\"}}}"
read 389 bytes
Conn keep-alive
SSL verification is disabled
opening connection to localhost:9292...
opened
<- "POST /pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/metadata/c1tdW3RdPXByb2Qmc1tdW2xdPXRydWUmc1tdW2N2XT02MCZwPWZhbHNl/verification-results HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json, */*\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nHost: localhost:9292\r\nContent-Length: 1355\r\n\r\n"
<- "{\"success\":true,\"providerApplicationVersion\":\"1.2.3\",\"testResults\":{\"tests\":[{\"testDescription\":\"has status code 200\",\"testFullDescription\":\"Verifying a pact between Foo and Bar A retrieve thing request with GET /thing returns a response which has status code 200\",\"status\":\"passed\",\"interactionProviderState\":null,\"interactionDescription\":\"a retrieve thing request\",\"actualStatus\":200},{\"testDescription\":\"has a matching body\",\"testFullDescription\":\"Verifying a pact between Foo and Bar A retrieve thing request with GET /thing returns a response which has a matching body\",\"status\":\"passed\",\"interactionProviderState\":null,\"interactionDescription\":\"a retrieve thing request\",\"actualBody\":{\"name\":\"Thing 1\"}},{\"testDescription\":\"\\\"Content-Type\\\" which equals \\\"application/json\\\"\",\"testFullDescription\":\"Verifying a pact between Foo and Bar A retrieve thing request with GET /thing returns a response which includes headers \\\"Content-Type\\\" which equals \\\"application/json\\\"\",\"status\":\"passed\",\"interactionProviderState\":null,\"interactionDescription\":\"a retrieve thing request\",\"actualHeaders\":{\"Content-Type\":\"application/json\"}}],\"summary\":{\"testCount\":3,\"failureCount\":0},\"metadata\":{\"warning\":\"These test results use a beta format. Do not rely on it, as it will definitely change.\",\"pactVerificationResultsSpecification\":{\"version\":\"1.0.0-beta.1\"}}}}"
-> "HTTP/1.1 201 Created\r\n"
-> "Vary: Accept\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Location: http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/verification-results/115\r\n"
-> "Content-Length: 2180\r\n"
-> "Date: Fri, 01 Oct 2021 06:54:35 GMT\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.86.0\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Connection: Keep-Alive\r\n"
-> "\r\n"
reading 2180 bytes...
-> "{\"providerName\":\"Bar\",\"providerApplicationVersion\":\"1.2.3\",\"success\":true,\"verificationDate\":\"2021-10-01T16:54:35+10:00\",\"testResults\":{\"tests\":[{\"testDescription\":\"has status code 200\",\"testFullDescription\":\"Verifying a pact between Foo and Bar A retrieve thing request with GET /thing returns a response which has status code 200\",\"status\":\"passed\",\"interactionProviderState\":null,\"interactionDescription\":\"a retrieve thing request\",\"actualStatus\":200},{\"testDescription\":\"has a matching body\",\"testFullDescription\":\"Verifying a pact between Foo and Bar A retrieve thing request with GET /thing returns a response which has a matching body\",\"status\":\"passed\",\"interactionProviderState\":null,\"interactionDescription\":\"a retrieve thing request\",\"actualBody\":{\"name\":\"Thing 1\"}},{\"testDescription\":\"\\\"Content-Type\\\" which equals \\\"application/json\\\"\",\"testFullDescription\":\"Verifying a pact between Foo and Bar A retrieve thing request with GET /thing returns a response which includes headers \\\"Content-Type\\\" which equals \\\"application/json\\\"\",\"status\":\"passed\",\"interactionProviderState\":null,\"interactionDescription\":\"a retrieve thing request\",\"actualHeaders\":{\"Content-Type\":\"application/json\"}}],\"summary\":{\"testCount\":3,\"failureCount\":0},\"metadata\":{\"warning\":\"These test results use a beta format. Do not rely on it, as it will definitely change.\",\"pactVerificationResultsSpecification\":{\"version\":\"1.0.0-beta.1\"}}},\"verifiedBy\":{},\"_links\":{\"self\":{\"title\":\"Verification result\",\"name\":\"Verification result 115 for Pact between Foo (1.0.0) and Bar\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/verification-results/115\"},\"pb:pact-version\":{\"title\":\"Pact\",\"name\":\"Pact between Foo (1.0.0) and Bar\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/metadata/Y3ZuPTEuMC4w\"},\"pb:triggered-webhooks\":{\"title\":\"Webhooks triggered by the publication of this verification result\",\"href\":\"http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/verification-results/115/triggered-webhooks\"}}}"
read 2180 bytes
Conn keep-alive
INFO: Verification results published to http://localhost:9292/pacts/provider/Bar/consumer/Foo/pact-version/0e3369199f4008231946e0245474537443ccda2a/verification-results/115
mkj28 commented 3 years ago

I must have been hitting some weird issue in our CI system - the env variables not passed from parent or something. But once I hardcoded them in the docker container running the tests -all went through fine.

mkj28 commented 3 years ago

So to summarize what worked for us: 1) pick up https://github.com/pact-foundation/pact-ruby-standalone/releases/tag/v1.88.74 (comes with https://github.com/pact-foundation/pact-ruby/releases/tag/v1.60.0) 2) run with PACT_DISABLE_SSL_VERIFICATION=true

bethesque commented 3 years ago

That's a relief! I don't know when I'll have time to address the issue properly, but at least we have a workaround in the meantime.

dimkin-eu commented 3 years ago

@bethesque should it be added to broker docker?

bethesque commented 3 years ago

Sorry, I don't understand the question.

dimkin-eu commented 3 years ago

i cant interact with pact broker, due SSL https://pact-foundation.slack.com/archives/C5F4KFKR8/p1633068329189800

➤ YN0000:     Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 3 of 3
➤ YN0000: 
➤ YN0000:     .../.yarn/unplugged/@pact-foundation-pact-node-npm-10.12.2-cc2bb34b6a/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.49/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError)
➤ YN0000:       from .../.yarn/unplugged/@pact-foundation-pact-node-npm-10.12.2-cc2bb34b6a/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.49/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
➤ YN0000:       from .../.yarn/unplugged/@pact-foundation-pact-node-npm-10.12.2-cc2bb34b6a/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.49/pact/lib/ruby/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
➤ YN0000:       from .../.yarn/unplugged/@pact-foundation-pact-node-npm-10.12.2-cc2bb34b6a/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.49/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect'
➤ YN0000:       from .../.yarn/unplugged/@pact-foundation-pact-node-npm-10.12.2-cc2bb34b6a/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.49/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
➤ YN0000:       from .../.yarn/unplugged/@pact-foundation-pact-node-npm-10.12.2-cc2bb34b6a/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.49/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:852:in `start'
➤ YN0000:       from .../.yarn/unplugged/@pact-foundation-pact-node-npm-10.12.2-cc2bb34b6a/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.49/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/hal/http_client.rb:55:in `block in perform_request'

same from scala

[info]   Cause: au.com.dius.pact.core.pactbroker.InvalidNavigationRequest: Failed to fetch the root HAL document
[info]   at au.com.dius.pact.core.pactbroker.HalClient.navigate(HalClient.kt:232)
[info]   at au.com.dius.pact.core.pactbroker.PactBrokerClient$fetchConsumersWithSelectors$halClient$navigateResult$1.invoke(PactBrokerClient.kt:233)
[info]   at au.com.dius.pact.core.support.KotlinLanguageSupportKt.handleWith(KotlinLanguageSupport.kt:38)
[info]   at au.com.dius.pact.core.pactbroker.PactBrokerClient.fetchConsumersWithSelectors(PactBrokerClient.kt:233)
[info]   at au.com.dius.pact.provider.ProviderInfo.hasPactsFromPactBrokerWithSelectors(ProviderInfo.kt:94)
[info]   at pact4s.ProviderInfoBuilder.applyBrokerSourceToProvider(ProviderInfoBuilder.scala:159)
[info]   at pact4s.ProviderInfoBuilder.toProviderInfo(ProviderInfoBuilder.scala:115)
[info]   at pact4s.PactVerifyResources.providerInfo(PactVerifyResources.scala:35)
[info]   at pact4s.PactVerifyResources.providerInfo$(PactVerifyResources.scala:35)

   Cause: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[info]   at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
[info]   at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:369)
[info]   at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:312)
[info]   at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:307)
[info]   at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1357)
[info]   at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1232)
[info]   at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1175)
[info]   at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
[info]   at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
[info]   at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458)
mkj28 commented 3 years ago

@dimkin-eu you need pact-1.60.0 for PACT_DISABLE_SSL_VERIFICATION=true to work , you have pact-1.57.0

mkj28 commented 3 years ago

@bethesque one more place it seems :( but same change as here probably: https://github.com/pact-foundation/pact_broker-client/blob/1f18e70a2cd3ad7c90eb052d95c5ebb85affe4db/lib/pact_broker/client/hal/http_client.rb#L72

(not sure why PACT_DISABLE_SSL_VERIFICATION=true does not work there, should it work through https://github.com/pact-foundation/pact_broker-client/commit/eb2125b9579bf5f8f8b7ada160b98094d32ebc01)

dimkin-eu commented 3 years ago

@mkj28 so this must be added to broker or to pact - js/scala/nameit ?

mefellows commented 3 years ago

The env var is for the ruby client @dimkin-eu.

vpriem commented 3 years ago

Using @pact-foundation/pact@9.16.2 and @pact-foundation/pact-node@10.13.7 and PACT_DISABLE_SSL_VERIFICATION=true.

Publishing pacts to the broker pact.publishPacts() is working fine again. However verifying pacts new Verifier().verifyProvider() is not. Getting:

Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 1 of 3

Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 2 of 3

Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed , attempt 3 of 3

/node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError)
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/ruby/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in `connect'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:852:in `start'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/hal/http_client.rb:55:in `block in perform_request'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/retry.rb:23:in `until_true'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/hal/http_client.rb:49:in `perform_request'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/hal/http_client.rb:24:in `get'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/hal/link.rb:49:in `get'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:53:in `index'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:38:in `call'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:34:in `call'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-1.57.0/lib/pact/pact_broker.rb:18:in `fetch_pact_uris_for_verification'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:45:in `pacts_for_verification'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:38:in `pacts_urls_from_broker'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:25:in `call'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:10:in `call'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/app.rb:206:in `all_pact_urls'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/app.rb:219:in `warn_empty_pact_set'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/app.rb:39:in `call'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/app.rb:34:in `call'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/cli/verify.rb:48:in `verify'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.35.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'
from /node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.63/pact/lib/app/pact-provider-verifier.rb:33:in `<main>'

at ChildProcess.<anonymous> (../../node_modules/@pact-foundation/pact-node/src/verifier.ts:272:58)
dimkin-eu commented 3 years ago

@vpriem there are pact-1.57.0 inside :( so some massive bump everywhere is needed

bethesque commented 3 years ago

@TimothyJones can you please push out the latest pact-ruby-standalone with pact-node?

bethesque commented 3 years ago

(not sure why PACT_DISABLE_SSL_VERIFICATION=true does not work there, should it work through pact-foundation/pact_broker-client@eb2125b)

Might be because the standalone doesn't execute through the bin file. I've pushed out a fix, and it should be in the latest standalone in a few minutes.

bethesque commented 3 years ago

Emergency release, thanks @mefellows! Try again now.

mefellows commented 3 years ago

So I've pushed it out to Pact JS ( / Pact Node). Other languages will need this too.

@dimkin-eu pact4s uses Pact JVM under the hood right? I suspect it will depend on the version of Java you have and the bundled CA in that runtime. Unless I'm mistaken, Pact JVM doesn't try and do anything special with certificates, so you will need to either upgrade your runtime or add any certificates to the JDK trust store.

@uglyog FYI in case you see a spike in activity.