mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
Is it possible to use WireMock as a proxy server for HTTPS requests? #548
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 @robvangeloven on GitHub (Oct 11, 2023).
Originally assigned to: @StefH on GitHub.
So I have a use case where I'm stuck with a hardcoded URL embedded in an external SDK. There is no way for me to change that behaviour and I do need to verify the output somehow for my current use case.
I though to myself: what if I make WireMock the default proxy server? And that does work, but only for HTTP calls. HTTPS calls get a
However, if I remove the WireMock-as-proxy setting and make the call directly it works just fine. Only I have trouble figuring out why this is.
@PG-RichT commented on GitHub (Oct 12, 2023):
@robvangeloven I'd be interested to see a response to this as I find myself in the same position. This wouldn't happen to be the Adyen SDK by any chance?
@robvangeloven commented on GitHub (Oct 12, 2023):
Buckaroo, so same difference really 😅
@StefH commented on GitHub (Oct 12, 2023):
When calling the https endpoint from WireMock.Net via Postman (SSL certificate verification= true), does that work ?
And maybe these pages can help you?
@robvangeloven commented on GitHub (Oct 12, 2023):
I haven't tested it via Postman, mostly because the code works just fine if I don't point the default httpclient proxy to the WireMock instance. If WireMock is configured to be the default proxy though (no other changes). I get weird SSL errors.
See also the code I linked: if I remove the
Everything works just fine. With it: SSL errors. HTTP calls work fine in both cases by the way.
@StefH commented on GitHub (Oct 14, 2023):
@robvangeloven
I'm able to reproduce your issue (https://github.com/WireMock-Net/WireMock.Net/pull/1010), however I do not have any idea on the root cause.
@StefH commented on GitHub (Oct 14, 2023):
@robvangeloven / @PG-RichT
After some investigating I now understand what you are trying to to.
However, configuring WireMock.Net to act as a proxy-server is possible. For this purpose you should use a different solution / NuGet.
@StefH commented on GitHub (Oct 14, 2023):
https://github.com/WireMock-Net/WireMock.Net/pull/1010
@robvangeloven commented on GitHub (Oct 17, 2023):
@PG-RichT / anyone reading this: the FryProxy or BenderProxy could help as a MITM proxy your solution