Pact-broker behind reverse proxy - Unable to publish and verify provider
See original GitHub issueI have set up pact broker behind a reverse proxy. Getting error while trying to publish and verify the pact. The same works with non-ssl URL
Pact publish error log :
Could not publish pact:
Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed /Users/loheswaran_g/Work/wag-src-repo/fork/boilerplate/react-ui-boilerplate/node_modules/@pact-foundation/pact-node/standalone/darwin-1.43.1/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.14.1/lib/pact_broker/client/pacts.rb:35:in `get', attempt 1 of 3
Pact verify provider error log :
Error: the string "Unable to find pacts for given provider 'APIHealthCheckService' and tags ''" was thrown, throw an Error :)
at tryCatch (node_modules/es6-promise/dist/lib/es6-promise/-internal.js:188:12)
at invokeCallback (node_modules/es6-promise/dist/lib/es6-promise/-internal.js:203:13)
at publish (node_modules/es6-promise/dist/lib/es6-promise/-internal.js:177:7)
at publishRejection (node_modules/es6-promise/dist/lib/es6-promise/-internal.js:118:3)
at flush (node_modules/es6-promise/dist/lib/es6-promise/asap.js:92:5)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (12 by maintainers)
Top Results From Across the Web
Pact-broker behind reverse proxy - Unable to publish ... - GitHub
I have set up pact broker behind a reverse proxy. Getting error while trying to publish and verify the pact. The same works...
Read more >pact-foundation/pact_broker - Gitter
Hi, were using Pact Broker with java and I've noticed that when we publish a new verification result the Location value returned in...
Read more >Publishing results of pact-verify to pact-broker - Stack Overflow
I'm kinda new in pact and I'm trying to make some POC of using pact, but I got stuck on a problem with...
Read more >Introduction | Pact Docs
The Pact Broker is an application for sharing consumer driven contracts and verification results. It is optimised for use with "pacts" ...
Read more >Securing the Pact Broker with Nginx & LetsEncrypt - Medium
Dockerised Pact Broker — Secure Implementation ... If you are able to use your cloud provider to sign your certificates, then you may...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What worked for me:
To publish with
pact-node
orpact-js
do the following:Download your certificate chain that your broker is using. If pulled right out of chrome you will most likely have
.cer
files.For example:
Convert those
.cer
files to.crt
files by doing:$ openssl x509 -inform DER -in root.cer -out root.crt
$ openssl x509 -inform DER -in intermediate.cer -out intermediate.crt
$ openssl x509 -inform DER -in ssl_certificate.cer -out ssl_certificate.crt
Then for ruby to recognize it properly it must be a bundle, so let’s bundle these together similar to the
ca-bundle.crt
$ cat root.crt intermediate.crt ssl_certificate.crt > ca-bundle.crt
Now within your javascript you must set the
SSL_CERT_FILE
that the standalone mentions. Make sure thecertPath
variable resolves to the correct path:Which takes me back to my original comment. This is a node TLS configuration, I haven’t tested myself but in theory adding your CA and/or self-signed certificate to the NodeJS runtime configuration should be all that is required.