Deprecated page
We no longer actively support this path of running traffic. While it's still possible to make this work, we recommend getting in touch to talk through better options.
You can use mitmproxy to generate a HTTP Archive format (HAR) file for encrypted HTTPS traffic. Akita can then convert the HAR file into an API spec.
Convert HAR File to API Spec
All you need is a single command to convert a HAR file into an API spec:
akita apispec --traces path/to/trace.har \
--out akita://myProject:spec:mySpec
Learn more about the apispec command by running akita apispec --help or akita man apispec.
Generate HAR File using mitmdump
In this example, we're going to generate a HAR file for encrypted traffic using mitmdump, which is part of the mitmproxy ecosystem.
Step 1: Download the official HAR conversion script.
You can find the python script for converting mitmdump to HAR file on GitHub (link).
wget https://raw.githubusercontent.com/mitmproxy/mitmproxy/master/examples/contrib/har_dump.py
Step 2: Start mitmdump to dump HAR file
mitmdump -s ./har_dump.py --set hardump=./dump.har
Step 3: Direct some traffic through the proxy.
You can configure your browser or system to use the local proxy started by mitmdump. Here we demonstrate an example using curl.
curl -D - -k --proxy localhost:8080 https://www.google.com
Generate HAR file using Charles Proxy
In this example, we're going to generate a HAR file for encrypted traffic using Charles Proxy.
Step 1: Enable SSL Proxy for All Hosts
Under Proxy > SSL Proxying Settings:
- Make sure "Enable SSL Proxying" is checked
- Add a new Host
*to enable SSL proxying for all requests.
Step 2: Direct some traffic through the proxy.
You can configure your browser or system to use the local proxy started by mitmdump. Here we demonstrate an example using curl.
curl -D - -k --proxy localhost:8888 https://www.google.com
Step 3: Export a HAR file
Under File > Export Session, select HTTP Archive (.har) as the Filter.
