https://pact.io logo
#pact-jvm
Title
# pact-jvm
p

Pavlo Sprogis

04/14/2022, 1:55 PM
hi guys, I want to try using Pactflow, I have updated provider tests configuration (host, scheme and token) but now test fails with the following errors:
Copy code
ERROR [15:45:47] [main] a.c.d.p.c.p.HalClient          Failed to fetch the root HAL document
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
...
is there a way to fix this (on my laptop and during CI build) ?
y

Yousaf Nabi (pactflow.io)

04/14/2022, 2:42 PM
Hey, Have you specified a custom trust store?
p

Pavlo Sprogis

04/14/2022, 2:46 PM
ok, thank you, I also found this article https://confluence.atlassian.com/kb/unable-to-connect-to-ssl-services-due-to-pkix-path-building-failed-error-779355358.html it looks like overkill to me, I do not have any custom trust store. I had something similar with RestAssured and it was possible to fix with 1 config line
Copy code
useRelaxedHTTPSValidation
ok, I should read those links, maybe it is not such an overhead as it looks like
y

Yousaf Nabi (pactflow.io)

04/14/2022, 2:46 PM
p

Pavlo Sprogis

04/14/2022, 2:47 PM
wow, that’s what I want, thank you!:)
y

Yousaf Nabi (pactflow.io)

04/14/2022, 2:48 PM
always read the manual 😅 don't worry I go blind too
also it's not the easiest to find, proactively working on making it easier, open to ideas. Best of luck on your Pact journey
p

Pavlo Sprogis

04/14/2022, 2:49 PM
I see that the documents are about provider tests, but I get this error when pact is trying to connect to pactflow instance
so if I use my own PactBroker deployed in our local network (http) - no errors
if I switch to pactflow (https) - I get the error about “Failed to fetch the root HAL document”
s

Stefano Lucka

04/14/2022, 5:17 PM
I got that error only in conjunction with missing or bad credentials from pactflow.io side. You are sending the token right?
🌮 1
🙌 1
p

Pavlo Sprogis

04/14/2022, 7:52 PM
yes, env variable is set and I use it in the test:
Copy code
authentication = @PactBrokerAuth(token = "${PACT_BROKER_TOKEN}"
but PACT_BROKER_HOST was wrong - my local pact broker instead of pactflow, now it works, thanks for help!
🙌 1
y

Yousaf Nabi (pactflow.io)

04/14/2022, 8:27 PM
Excellent @Pavlo Sprogis, glad you are rocking now and thanks for the support @Stefano Lucka ! 🙌 mental note made for dx improvements!
162 Views