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

Add option tlsIntercept #166

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

lipsumar
Copy link
Contributor

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

  • tlsPassthrough: intercept everything except hostnames in this list
  • tlsIntercept: intercept nothing except hostnames in this list

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

CLAassistant commented Mar 28, 2024

CLA assistant check
All committers have signed the CLA.

@lipsumar
Copy link
Contributor Author

lipsumar commented Apr 2, 2024

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

Copy link
Member

@pimterry pimterry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that @lipsumar. The changes all look good here. Unfortunately though the CI tests have highlighted that the current test suite fails in the latest version of Node that was just released (v20.12.0) due to some kind of HTTP/2 changes, so I'm going to need to get that resolved before merging.

I'll look into that shortly and let you know once it's sorted so we can rebase this & merge it happily.

@pimterry pimterry force-pushed the add-tls-intercept-option branch from 93a909a to 00b1064 Compare April 3, 2024 13:46
@pimterry pimterry merged commit f4543bb into httptoolkit:main Apr 3, 2024
9 checks passed
@pimterry
Copy link
Member

pimterry commented Apr 3, 2024

Thanks @lipsumar! Rebased & merged 👍. 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
Copy link
Contributor Author

lipsumar commented Apr 4, 2024

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

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

Successfully merging this pull request may close these issues.

3 participants