pact-foundation / pact-js

JS version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.
https://pact.io
Other
1.63k stars 347 forks source link

BadSignature error when approaching broker on HTTPS #1219

Open orenhan opened 5 months ago

orenhan commented 5 months ago

Software versions

Issue Checklist

Please confirm the following:

Expected behaviour

setting disableSslVerifications: true will fix BadSignature error when broker is on https

Actual behaviour

setting disableSslVerifications: true didn't have an effect

Steps to reproduce

deploy pact broker with https endpoint publish contract from consumer try to verify pacts from provider running locally

Hi :) I'm using PactJs version 12.3.0, and have a pact broker deployed on openshift. on the consumer part - everything works well. contract are published correctly through the cicd pipeline. on the provider part - I created a unit test with jest for verifying contracts using Verifier. I keep getting an error: Failed to load pact - No pacts found under provider 'provider' matching the given consumer version selectors in pact broker 'https://pact.broker': IO Error - Failed to access pact broker path '/' - error sending request for url (https://pact.broker/): error trying to connect: invalid peer certificate: BadSignature. URL: 'https://pact.broker' certificate is indeed invalid, but I just want to disable ssl verification. In the consumer cicd I used PACT_DISABLE_SSL_VERIFICATION and it worked, but with the Verifier it looks like disableSslVerification has no impact.

I will mention again - I work on a private network and cannot attach log or code files, I can copy specific things. sorry for that :(

Thanks!

orenhan commented 5 months ago

also tried using validateSsl, didn't change anything

mefellows commented 5 months ago

I think this might be related to https://github.com/pact-foundation/pact-reference/issues/387

orenhan commented 5 months ago

I have now fixed my certificate, its valid, yet the same error occurs

mefellows commented 5 months ago

Are you getting the same error or a different one? If the certificate is valid, it shouldn't be erroring obviously. Can you share the certificate here for review?

orenhan commented 5 months ago

I cant share my certificate because I work on a private network and exporting files from it is a long process, anything specific about the certificate that can help?