-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Turn off SSL verification for provider states setup call.
This allows the setup to work on servers that use self signed certificates. Also, removed unused dependency on pact-provider-proxy gem, and use rack-reverse-proxy directly.
- Loading branch information
Showing
5 changed files
with
49 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'support/provider_with_self_signed_cert' | ||
|
||
describe "verifying a provider that uses a self signed certificate" do | ||
before(:all) do | ||
@ssl_server_pid = fork do | ||
run_provider_with_self_signed_cert 4568 | ||
end | ||
sleep 2 | ||
end | ||
|
||
subject { `bundle exec bin/pact-provider-verifier -a 1.0.0 --provider-base-url https://localhost:4568 --pact-urls ./test/me-they.json --provider_states_setup_url https://localhost:4568/provider-state -v` } | ||
|
||
it "passes because it has SSL verification turned off" do | ||
expect(subject).to include "2 interactions, 0 failures" | ||
end | ||
|
||
after(:all) do | ||
Process.kill('INT', @ssl_server_pid) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require_relative 'provider' | ||
|
||
def run_provider_with_self_signed_cert port | ||
trap 'INT' do @server.shutdown end | ||
require 'rack' | ||
require 'rack/handler/webrick' | ||
require 'webrick/https' | ||
|
||
webrick_opts = {:Port => port, :SSLEnable => true, :SSLCertName => [%w[CN localhost]]} | ||
Rack::Handler::WEBrick.run(Provider, webrick_opts) do |server| | ||
@server = server | ||
end | ||
end | ||
|
||
if __FILE__== $0 | ||
run_provider_with_self_signed_cert 4568 | ||
end |