Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to pass a X509Certificate2 to WithProxy() or specifiy certificate loading options #879

Closed
FlorianMeinschad opened this issue Jan 30, 2023 · 7 comments
Assignees
Labels

Comments

@FlorianMeinschad
Copy link

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):

  • X509StoreLocation
  • X509StoreName
  • X509StoreThumbprintOrSubjectName
  • X509CertificateFilePath
  • X509CertificatePassword

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
image

image

Thanks in advance.

@StefH
Copy link
Collaborator

StefH commented Jan 31, 2023

I think creating a third method with WireMockCertificateSettings is the easiest solution.

I think creating a third method with X509Certificate2 is the easiest solution.
I'll take a look.

@StefH
Copy link
Collaborator

StefH commented Jan 31, 2023

Can you try preview 1.5.15-ci-17006 ?

https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions

@StefH StefH self-assigned this Feb 1, 2023
@StefH
Copy link
Collaborator

StefH commented Feb 1, 2023

#880

@FlorianMeinschad
Copy link
Author

Works like a charm =)
Thank you very much, we really appreciate it!

@StefH
Copy link
Collaborator

StefH commented Feb 1, 2023

@FlorianMeinschad
I'll create a new official NuGet today.

@StefH StefH closed this as completed Feb 1, 2023
@FlorianMeinschad
Copy link
Author

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
Copy link
Collaborator

StefH commented Feb 6, 2023

@FlorianMeinschad Sorry, I forgot to start the NuGet pipeline. It's running now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants