You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Client certificate authentication works with .NET 8 and fails with .NET 9 #1365
_mockSignPathApi = WireMockServer.Start(
new WireMockServerSettings
{
Port = 8888,
ClientCertificateMode = ClientCertificateMode.AllowCertificate,
AcceptAnyClientCertificate = true,
UseSSL = true
});
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).
OK, by default it loads it with the flag EphemeralKeySet which doesn't work.
Using the flags Exportable | UserKeySet when loading with X509CertificateLoader fixes the problem.
May it help you when migrating the project to .NET9+ :-)
Activity
drauch commentedon 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 commentedon 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 commentedon Oct 12, 2025
@drauch
I keep this bug open as reminder.
StefH commentedon Nov 12, 2026
#1543