WireMock.Net icon indicating copy to clipboard operation
WireMock.Net copied to clipboard

Does WireMock support mocking HTTPS requests?

Open wirtual11 opened this issue 3 years ago • 5 comments

From I can see is that proxy catches a request BUT it's a CONNECT HTTP method which later results in a response to a client "No mapping found".

wirtual11 avatar Nov 25 '21 00:11 wirtual11

Same question. My example: I have WebApi which from inside the code calls external url which is https. My WebAPI is setup to proxy all requests to wiremock server. So wiremock will catch the request but it will return "No mapping found". If I will remove all mapping criteria, I can see in RequestMessage that it's CONNECT.

suszi88 avatar Nov 26 '21 10:11 suszi88

@wirtual11 and @suszi88 It is possible to run WireMock.Net at https.

Did you check this page? https://github.com/WireMock-Net/WireMock.Net/wiki/Using-HTTPS-%28SSL%29

StefH avatar Feb 27 '22 19:02 StefH

Hi @StefH , thank you for your reply, sorry I didn't reply earlier, I had to miss your comment as was on holidays. I saw the page and I set it up before but this is not what I asked for. What I asked is: I have api which need to send request to https url, let say my api is creating request and senting it to https://SomeValidUrl.com. Now I cannot change this url, what I wanted to do is to have proxy which will take my request with original url and sent it to my mock server https://localhost:8080. So I'm proxing my request to witemock. Now I was able to retrieve it but probably due to https character I cannot read the content of request. Now given I have valid cert of api which is sending this, can it be setup in wiremock? I have no problem if same setup is with http://SomeValidUrl.com url. Thanks

suszi88 avatar Apr 22 '22 14:04 suszi88

@suszi88 Did you view these pages?

  • https://github.com/WireMock-Net/WireMock.Net/wiki/Using-HTTPS-(SSL)
  • https://github.com/WireMock-Net/WireMock.Net/wiki/Settings#certificatesettings

StefH avatar Jun 09 '22 19:06 StefH

@suszi88 Did you have time to read the wiki pages mentioned in my last comment?

StefH avatar Sep 19 '22 05:09 StefH

@suszi88 I'll close this issue.

In case you still have questions, comment here or open a new specific issue.

StefH avatar Oct 12 '22 17:10 StefH