httptoolkit / mockttp

Powerful friendly HTTP mock server & proxy library
https://httptoolkit.com
Apache License 2.0
775 stars 88 forks source link

Add option `tlsIntercept` #166

Closed lipsumar closed 6 months ago

lipsumar commented 6 months ago

This PR adds an option tlsIntercept to MockttpHttpsOptions. This option is the inverse of the existing tlsPassthrough:

Both options can not be used at the same time.

This option allows mockttp to be less intrusive and to let most requests untouched, except for a specific list of hostnames. This helps keep some applications using certificate pinning working correctly.

Related issue: #162

@pimterry let me know if you'd prefer more tests and/or if docs need to be adjusted.

CLAassistant commented 6 months ago

CLA assistant check
All committers have signed the CLA.

lipsumar commented 6 months ago

@pimterry sorry for the delay on signing the CLA, I needed approval. We're all set!

pimterry commented 6 months ago

Thanks @lipsumar! Rebased & merged :+1:. I've renamed the option slightly here and gone for tlsInterceptOnly to make it a bit clearer what this is doing.

I'll release this shortly as part of v3.11.0.

lipsumar commented 6 months ago

tlsInterceptOnly makes a lot of sense, good call 👍 Thanks for your reactivity !