mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Possibility to pass a X509Certificate2 to WithProxy() or specifiy certificate loading options #481
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 @FlorianMeinschad on GitHub (Jan 30, 2023).
Originally assigned to: @StefH on GitHub.
Is your feature request related to a problem? Please describe.
We would like to run our wiremock.net setup in a custom docker container.
If no mapping is found for a request, the request is proxied to our staging server, which needs client certificate authentication.
At the moment the WireMock.NET tries to load the certificate by thumbprint or subject name from StoreLocation.LocalMachine, which does not exists on unix and throws an error.
Describe the solution you'd like
The best possible solution for us would be a third method overload for WithProxy(), which accepts a X509Certificate2 as parameter. Then we would be able to load the certificate from a mapped docker volume.
Describe alternatives you've considered
Alternatively it would also be enough to be able to specify the certificate loading options (like the WireMockCertificateSettings class):
Thereby it would also be possible to load a certificate from a mapped docker volume or to specify the unix permitted store "CurrentUser".
Is your feature request supported by WireMock (java version)? Please provide details.
I think it's just an extension of the .NET project itself, no explicit relation to wiremock.
Additional context

Thanks in advance.
@StefH commented on GitHub (Jan 31, 2023):
I think creating a third method withWireMockCertificateSettingsis the easiest solution.I think creating a third method with
X509Certificate2is the easiest solution.I'll take a look.
@StefH commented on GitHub (Jan 31, 2023):
Can you try preview
1.5.15-ci-17006?https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions
@StefH commented on GitHub (Feb 1, 2023):
https://github.com/WireMock-Net/WireMock.Net/pull/880
@FlorianMeinschad commented on GitHub (Feb 1, 2023):
Works like a charm =)
Thank you very much, we really appreciate it!
@StefH commented on GitHub (Feb 1, 2023):
@FlorianMeinschad
I'll create a new official NuGet today.
@FlorianMeinschad commented on GitHub (Feb 6, 2023):
Unfortunately, there is still no official NuGet version 1.16.
May it be possible to create it soon?
That would be great, thank you!
@StefH commented on GitHub (Feb 6, 2023):
@FlorianMeinschad Sorry, I forgot to start the NuGet pipeline. It's running now...