Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPS pact broker not supported #37

Closed
audunhalland opened this issue Apr 24, 2019 · 8 comments · Fixed by #42
Closed

HTTPS pact broker not supported #37

audunhalland opened this issue Apr 24, 2019 · 8 comments · Fixed by #42

Comments

@audunhalland
Copy link
Contributor

audunhalland commented Apr 24, 2019

Running the verifier with:

./target/debug/pact_verifier_cli --provider-name myProvider --broker-url https://anything.com --hostname http://localhost:9999 --state-change-url http://localhost:9999/_pactSetup

Yields:

Failures:

0) Failed to load pact - Could not load pacts from the pact broker 'https://anything.com' - IoError("Failed to access pact broker path \'/\' - \"Invalid scheme for Http\". URL: \'https://anything.com\'")

I guess this is related to hyperium/hyper#1009, and https support needs to be provided as a separate library.

I would be more than happy to help the project, so maybe you'll see a PR from me when I get the time.

@audunhalland
Copy link
Contributor Author

Awaiting a response from maintainer, as I'm not sure how to proceed; whether to go for a more high level client like e.g. reqwest instead of hyper.

@uglyog
Copy link
Member

uglyog commented Apr 25, 2019

If reqwest works, we can go with that. There were no other options when this project was started than hyper. It is also still using the older blocking version, so an upgrade of hyper would require a rewrite.

@audunhalland
Copy link
Contributor Author

Ok, I can try first to upgrade to async hyper, and see what needs to be changed first. Not yet familiar with the code base and what will be implicated, but I'll surely find out.

@uglyog
Copy link
Member

uglyog commented Apr 25, 2019

Have a look at https://github.com/uglyog/pact-stub-server, I went through the upgrade there.

@audunhalland
Copy link
Contributor Author

Thanks, but just out of curiosity, what's the relation between that project and this project's pact_mock_server(_cli)?

@uglyog
Copy link
Member

uglyog commented Apr 25, 2019

The stub server uses the pact-rust matching libraries, but is just a convenience for people who want to have a server running off a set of pact files. The matching is a lot looser than the pact_mock_server.

@uglyog
Copy link
Member

uglyog commented Jul 27, 2019

Now that you have done all the hard work, we can come back to this issue. We can now use hyper-tls and native-tls crates to support HTTPS.

@audunhalland
Copy link
Contributor Author

audunhalland commented Jul 27, 2019

Up to you to decide how you want it to work. reqwest is a more high level client and supports stuff like redirect and proxies. Don't know if it's needed. I don't have a very strong opinion either, although hyper doc recommends that if you just want "a http client" (which we do?), use reqwest.

@audunhalland audunhalland mentioned this issue Jul 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants