mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 13:00:33 +01:00
Client certificate authentication works with .NET 8 and fails with .NET 9 #719
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 @drauch on GitHub (Oct 12, 2025).
Describe the bug
I'm using the following server settings:
and use your own client_cert.pfx from your test suite as client certificate. In .NET 8 this set up works, in .NET 9 this fails (i.e, the request fails, I don't even come to the point where I could assert whether it's there).
Expected behavior:
It should work with .NET 9 too.
Other related info
Newest WireMock.NET version.
@drauch commented on GitHub (Oct 12, 2025):
Ah the culprit seems to be your client_cert.pfx (https://github.com/wiremock/WireMock.Net/blob/master/test/WireMock.Net.Tests/client_cert.pfx) in the test suite.
.NET 8:
.NET 9:
@drauch commented on GitHub (Oct 12, 2025):
OK, by default it loads it with the flag
EphemeralKeySetwhich doesn't work.Using the flags
Exportable | UserKeySetwhen loading withX509CertificateLoaderfixes the problem.May it help you when migrating the project to .NET9+ :-)
Best regards,
D.R.
@StefH commented on GitHub (Oct 12, 2025):
@drauch
I keep this bug open as reminder.