Error when publishing on pactflow from windows
See original GitHub issueHi,
Step to reproduce :
-
I am on Microsoft Windows 10 Enterprise
-
i have downloaded the github project and have compiled
-
i have executed with success all Consumer.tests
-
I have published “event_api_consumer-event_api.json” $res = Invoke-WebRequest -Uri “https://olivier.pact.dius.com.au/pacts/provider/Event API/consumer/Event API Consumer/version/1.0.0+4jvh387gj3” -Headers @{Authorization = “Bearer XXXXXXMYKEYXXXXXXXX”} -Method Put -InFile “event_api_consumer-event_api.json” -ContentType “application/json”
-
From https://github.com/pact-foundation/pact-net/blob/master/Samples/EventApi/Provider.Api.Web.Tests/EventAPITests.cs, i have updated l42 as followed : .PactBroker(“https://olivier.pact.dius.com.au”, uriOptions: new PactUriOptions(“XXXXXXMYKEYXXXXXXXX”), consumerVersionTags: new List<string> { “master” })
-
When i am executing “EnsureEventApiHonoursPactWithConsumer”, i have the following error : Message: PactNet.PactFailureException : Pact verification failed. See output for details. If the output is empty please provide a custom config.Outputters (IOutput) for your test framework, as we couldn’t write to the console. Stack Trace: PactCoreHost`1.Start() line 139 PactVerifier.Verify(String description, String providerState) line 170 EventApiTests.EnsureEventApiHonoursPactWithConsumer() line 38
Open additional output for this result Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed , attempt 1 of 3 Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed , attempt 2 of 3 Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed , attempt 3 of 3 C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in
connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in
block in connect’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/timeout.rb:74:intimeout' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in
connect’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:863:indo_start' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:852:in
start’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/http_client.rb:55:inblock in perform_request' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/retry.rb:23:in
until_true’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/http_client.rb:49:inperform_request' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/http_client.rb:24:in
get’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/link.rb:49:inget' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:50:in
index’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:37:incall' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:33:in
call’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker.rb:18:infetch_pact_uris_for_verification' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:45:in
pacts_for_verification’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:38:inpacts_urls_from_broker' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:25:in
call’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:10:incall' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:197:in
all_pact_urls’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:40:in `call’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0
How can i fix this issue ?
Thank you !
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (8 by maintainers)
Top GitHub Comments
Hi Olivier,
Thanks for the detailed post.
As discussed in the support ticket, I think you’ll need to add the certificate from https://olivier.pact.dius.com.au (which is an AWS CA issued certificate, fairy recent) to your trust store. I’m not a Windows expert, but the following articles looks promising:
As for being able to download Pacts, as Beth noted, you are best using the verifier with the
PactBroker
option (just pointed to your broker, not an individual contract) as it will automatically pull contracts, verify them, publish the results etc. etc. If you pulled the contracts down manually and verified them one by one, you won’t be able to do a lot of the magic that Pact lets you do.I’ll add the PowerShell script to examples though.
You could try using the pact-ruby-standalone (which is the underlying CLI that pact-net uses) to publish the pacts. It works on windows. https://github.com/pact-foundation/pact-ruby-standalone/releases
Another other alternative is to use the docker container https://hub.docker.com/repository/docker/pactfoundation/pact-cli
Can I ask why you want do you need to do this? The verifier pulls pacts from the Pact Broker directly.