mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Facing SSL certificate validation error when using .NET 5 and above framework for some http services during recording #710
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tavisca-mjadhav on GitHub (Aug 4, 2025).
Originally assigned to: @StefH on GitHub.
Describe the bug
Facing issue when connecting to the service during recording. "The SSL connection could not be established, see inner exception."
Expected behavior:
Should successfully connect to the service and perform the recording.
Test to reproduce
Other related info
Since in .net 5 and above the SocketsHttpHandler has been introduced, the HttpClientHandler ServerCertificateCustomValidationCallback is not being considered when TLS1.3 is enforced.
Please check this for the fix that can be applied.
https://github.com/tavisca-mjadhav/WireMock.Net/blob/SSL-ISSUE-FIX/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs
OR enabling TLS13 will work.
@StefH commented on GitHub (Oct 5, 2025):
https://github.com/wiremock/WireMock.Net/pull/1363