oesmith / puffing-billy

A rewriting web proxy for testing interactions between your browser and external sites. Works with ruby + rspec.
MIT License
654 stars 170 forks source link

HTTPS stubbing _does_ in fact work without special certificate setup? #343

Open machty opened 4 months ago

machty commented 4 months ago

When I first read the README for Puffing Billy, I got to the "SSL usage" section and assumed that I would have to get my hands dirty running scripts and tweaking root certs and messing with Mac Keychain Access and the equivalent setup on Github Actions based on the following snippets from the README

Unfortunately we cannot setup the runtime certificate authority on your browser at time of configuring the Capybara driver. So you need to take care of this step yourself as a prepartion.

Google Chrome/Chromium is capable to run as a test browser with the new headless mode which is not able to handle the deprecated --ignore-certificate-errors flag.

From this I gathered that if I just tried to do proxy.stub("https://www.example.com:443/") then I would run into SSL errors unless did some additional setup/config with certs, but much to my delight, everything Just Worked.

Specifically, I'm stubbing a 3rd party tokenizing iframe with something like:

proxy.stub("https://request.eprotect.vantivprelive.com:443/eProtect/eProtect_foo_bar_api3_enhancedUx.html", ...)

So my question is: why didn't I run into issues? Are the docs out of date? Or are the docs describing some other use case involving SSL/HTTPS/TLS that my use case didn't hit?

Note that I'm only using Billy-flavored Chrome/Chromium browsers for testing.