How to install mitmproxy certificate on Chrome and Chromium?

by scrapecrow Jun 30, 2023
mitproxy is a popular man in the middle proxy used in web scraping operations. However, to use it for scraping https websites the custom certificate must be installed.

For Chrome and Chromium browsers follow these steps:

  1. Install mitmproxy using pip install mitmproxy or your systems package manager like:
    • Ubuntu: sudo apt install mitmproxy
    • MacOs: brew install mitmproxy
    • Windows: download binary from mitmproxy.org
  2. Run mitmproxy in the terminal and it'll start a proxy on localhost:8080 on your machine.
  3. Start Chrome instance with mitmproxy proxy attached to it:
    • Linux: google-chrome --proxy-server="localhost:8080"
    • MacOs: open -a "Google Chrome" --args --proxy-server="localhost:8080"
    • Windows: chrome.exe --proxy-server="localhost:8080"
  4. Open http://mitm.it in the browser and download the certificate for your system.
  5. Install the certificate to your Chrome or Chromium browser:
    1. Open chrome://settings/certificates in the browser.
    2. Click on Authorities tab.
    3. Click on Import button and select the certificate from the step 4.
chrome settings to install certificates

Now mitmproxy will be able to intercept and decrypt all https traffic going through it. This enables it being used with headless browser tools like Selenium, Playwright or Puppeteer.

Related Articles

Comprehensive Guide to OkHttp for Java and Kotlin

Learn how to simplify network communication in Java and Android applications using OkHttp.

HTTP
TOOLS
Comprehensive Guide to OkHttp for Java and Kotlin

cURL vs Wget: Key Differences Explained

curl and wget are both popular terminal tools but often used for different tasks - let's take a look at the differences.

CURL
HTTP
TOOLS
cURL vs Wget: Key Differences Explained

Sending HTTP Requests With Curlie: A better cURL

In this guide, we'll explore Curlie, a better cURL version. We'll start by defining what Curlie is and how it compares to cURL. We'll also go over a step-by-step guide on using and configuring Curlie to send HTTP requests.

CURL
HTTP
TOOLS
Sending HTTP Requests With Curlie: A better cURL

How to Use cURL For Web Scraping

In this article, we'll go over a step-by-step guide on sending and configuring HTTP requests with cURL. We'll also explore advanced usages of cURL for web scraping, such as scraping dynamic pages and avoiding getting blocked.

HTTP
TOOLS
CURL
How to Use cURL For Web Scraping

Use Curl Impersonate to scrape as Chrome or Firefox

Learn how to prevent TLS fingerprinting by impersonating normal web browser configurations. We'll start by explaining what the Curl Impersonate is, how it works, how to install and use it. Finally, we'll explore using it with Python to avoid web scraping blocking.

TOOLS
BLOCKING
CURL
HTTP
Use Curl Impersonate to scrape as Chrome or Firefox

FlareSolverr Guide: Bypass Cloudflare While Scraping

In this article, we'll explore the FlareSolverr tool and how to use it to get around Cloudflare while scraping. We'll start by explaining what FlareSolverr is, how it works, how to install and use it. Let's get started!

PYTHON
TOOLS
BLOCKING
HTTP
FlareSolverr Guide: Bypass Cloudflare While Scraping