New feature: Record and Save #27

Closed
opened 2025-12-29 14:21:16 +01:00 by adam · 9 comments
Owner

Originally created by @StefH on GitHub (May 5, 2017).

http://wiremock.org/docs/record-playback/

Originally created by @StefH on GitHub (May 5, 2017). http://wiremock.org/docs/record-playback/
adam closed this issue 2025-12-29 14:21:16 +01:00
Author
Owner

@StefH commented on GitHub (May 12, 2017):

Hello @phillee007 , if you have time, can you do some testing with Proxy and Record and Save ?

@StefH commented on GitHub (May 12, 2017): Hello @phillee007 , if you have time, can you do some testing with **Proxy** and **Record and Save** ?
Author
Owner

@phillee007 commented on GitHub (May 13, 2017):

Will have a try, although unfortunately all the real services we call require client certificates, so I'm not sure whether it will be possible. I saw a section on http://wiremock.org/docs/proxying/ about how to setup client certificate forwarding on java, but will have to do some reading to find out the .Net equivalent...

Have had a quick look at the code in HttpClientHelper, and I'm wondering if additional properties need to be added to the proxy settings class to enable, requests that proxy to thereal service to use a client certificate as specified by the client when initializing the proxying. E.g. assuming:

  • client certificate X is required by real service A (e.g. https://realservice.com)
  • client certificate X is in the machine store on the machine wiremock is running on

we need to tell wiremock that when proxying calls to realservice.com, it needs to read in certificate X from the cert store (most likely by providing a password also) and attach it when proxying the request. Alternatively, we could just read the client cert in as a byte array in the client, and tell wiremock to use that byte array when sending requests, thus not requiring wiremock to actually read the cert from the store.....

@phillee007 commented on GitHub (May 13, 2017): Will have a try, although unfortunately all the real services we call require client certificates, so I'm not sure whether it will be possible. I saw a section on http://wiremock.org/docs/proxying/ about how to setup client certificate forwarding on java, but will have to do some reading to find out the .Net equivalent... Have had a quick look at the code in HttpClientHelper, and I'm wondering if additional properties need to be added to the proxy settings class to enable, requests that proxy to thereal service to use a client certificate as specified by the client when initializing the proxying. E.g. assuming: - client certificate X is required by real service A (e.g. https://realservice.com) - client certificate X is in the machine store on the machine wiremock is running on we need to tell wiremock that when proxying calls to realservice.com, it needs to read in certificate X from the cert store (most likely by providing a password also) and attach it when proxying the request. Alternatively, we could just read the client cert in as a byte array in the client, and tell wiremock to use that byte array when sending requests, thus not requiring wiremock to actually read the cert from the store.....
Author
Owner

@StefH commented on GitHub (May 13, 2017):

What kind of certificate would you be using ?
Is that a X509Certificate2 ?

@StefH commented on GitHub (May 13, 2017): What kind of certificate would you be using ? Is that a **X509Certificate2** ?
Author
Owner

@phillee007 commented on GitHub (May 13, 2017):

Yep that's right

On 13/05/2017 11:13 PM, "Stef Heyenrath" notifications@github.com wrote:

What kind of certificate would you be using ?
Is that a X509Certificate2 ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/StefH/WireMock.Net/issues/27#issuecomment-301241692,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEEFowf9en98ZPEp8ZX4cXt5tVUYw040ks5r5ZBXgaJpZM4NSOlv
.

@phillee007 commented on GitHub (May 13, 2017): Yep that's right On 13/05/2017 11:13 PM, "Stef Heyenrath" <notifications@github.com> wrote: > What kind of certificate would you be using ? > Is that a *X509Certificate2* ? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/StefH/WireMock.Net/issues/27#issuecomment-301241692>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AEEFowf9en98ZPEp8ZX4cXt5tVUYw040ks5r5ZBXgaJpZM4NSOlv> > . >
Author
Owner

@StefH commented on GitHub (May 16, 2017):

I've updated the code and added logic to provide X509Certificate2Filename.

I'm not sure if this works, I'm unable to test this myself.

@StefH commented on GitHub (May 16, 2017): I've updated the code and added logic to provide `X509Certificate2Filename`. I'm not sure if this works, I'm unable to test this myself.
Author
Owner

@phillee007 commented on GitHub (May 16, 2017):

Thanks Stef. I'll give it a try and submit a PR if I need to change it :-)

On 17/05/2017 6:21 AM, "Stef Heyenrath" notifications@github.com wrote:

I've updated the code and added logic to provide X509Certificate2Filename.

I'm not sure if this works, I'm unable to test this myself.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/StefH/WireMock.Net/issues/27#issuecomment-301871013,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEEFowEM4jy9GeB7bcU9W97L9uxkrfDxks5r6ek0gaJpZM4NSOlv
.

@phillee007 commented on GitHub (May 16, 2017): Thanks Stef. I'll give it a try and submit a PR if I need to change it :-) On 17/05/2017 6:21 AM, "Stef Heyenrath" <notifications@github.com> wrote: > I've updated the code and added logic to provide X509Certificate2Filename. > > I'm not sure if this works, I'm unable to test this myself. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/StefH/WireMock.Net/issues/27#issuecomment-301871013>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AEEFowEM4jy9GeB7bcU9W97L9uxkrfDxks5r6ek0gaJpZM4NSOlv> > . >
Author
Owner

@StefH commented on GitHub (Jun 9, 2017):

Any luck?

@StefH commented on GitHub (Jun 9, 2017): Any luck?
Author
Owner

@phillee007 commented on GitHub (Jun 9, 2017):

Not yet I'm afraid. Our testers took a while to get on board with the whole
concept of what wiremock actually does, so i had no spare time to test the
client cert stuff. I will in the next two weeks though :-)

On 10/06/2017 9:33 AM, "Stef Heyenrath" notifications@github.com wrote:

Any luck?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/StefH/WireMock.Net/issues/27#issuecomment-307505137,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEEFows6Bzc-X-sgKbYdZkLP8IjZ_rofks5sCbo0gaJpZM4NSOlv
.

@phillee007 commented on GitHub (Jun 9, 2017): Not yet I'm afraid. Our testers took a while to get on board with the whole concept of what wiremock actually does, so i had no spare time to test the client cert stuff. I will in the next two weeks though :-) On 10/06/2017 9:33 AM, "Stef Heyenrath" <notifications@github.com> wrote: > Any luck? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/StefH/WireMock.Net/issues/27#issuecomment-307505137>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AEEFows6Bzc-X-sgKbYdZkLP8IjZ_rofks5sCbo0gaJpZM4NSOlv> > . >
Author
Owner

@StefH commented on GitHub (Nov 18, 2017):

@phillee007
Closing for now, in case you have more time to investigate on this subject, please open a new issue.

@StefH commented on GitHub (Nov 18, 2017): @phillee007 Closing for now, in case you have more time to investigate on this subject, please open a new issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#27