pact-net
pact-net copied to clipboard
'WithSslVerificationDisabled' doesnt disable ssl verification
I'm trying to implement a simple provider test using pact-broker as the pact source. But I get a certificate verification error when connecting to the broker, although I use WithSslVerificationDisabled
. I also tried using the PACT_DISABLE_SSL_VERIFICATION and PACT_BROKER_DISABLE_SSL_VERIFICATION variables, but the error persists
Package - "PactNet" Version="4.5.0", OS - windows, framework - net7.0
Environment.SetEnvironmentVariable("PACT_DISABLE_SSL_VERIFICATION", "true");
Environment.SetEnvironmentVariable("PACT_BROKER_DISABLE_SSL_VERIFICATION", "true");
var pactVerifier = new PactVerifier(new PactVerifierConfig() { Outputters = new[] { new XunitOutput(testOutputHelper) }, LogLevel = PactLogLevel.Debug });
pactVerifier
.ServiceProvider("my_service", new Uri("http://localhost:5000"))
.WithPactBrokerSource(new Uri("https://myhost"), opt =>
{
opt.PublishResults(Guid.NewGuid().ToString());
})
.WithSslVerificationDisabled()
.Verify();
Verifier Logs: reqwest::async_impl::client: rustls failed to parse DER certificate MissingOrMalformedExtensions Certificate pact_verifier::pact_broker: Fetching path '/' from pact broker rustls::conn: Sending fatal alert BadCertificate pact_verifier: Failed to load pact - \x1b[31mCould not load pacts from the pact broker.