Skip to main content

MITM proxy with CA certificate management - server, client, and certificate tools

Project description

Owl Proxy

MITM proxy with CA certificate management — server, client, and certificate tools.

Install

pip install owl-proxy

Quick Start

# 1. Generate CA certificate
owl-proxy cert generate

# 2. Install CA into OS trust store (requires sudo)
owl-proxy cert install

# 3a. Run as a standalone proxy server
owl-proxy server --port 8443 --auth user:pass

# 3b. Run as a local MITM client (direct mode)
owl-proxy client --direct

# 3c. Run client forwarding through a remote server
owl-proxy client --remote http://my-server:8443 --auth user:pass

Certificate Setup

Owl Proxy uses a root CA to sign per-domain certificates for HTTPS interception. Both server and client need the CA certificate and private key.

Generate

owl-proxy cert generate
# Saves to ~/.owl-proxy/ca.crt and ~/.owl-proxy/ca.key

Export for sharing

# Full bundle (cert + key) — for setting up server/client on another machine
owl-proxy cert export -d ./certs

# Certificate only — for browser/OS trust installation
owl-proxy cert export -d ./certs --cert-only

Install to OS trust store

Installs the CA so browsers and system tools trust it automatically:

# Install from default location (~/.owl-proxy/ca.crt)
owl-proxy cert install

# Install from a specific path
owl-proxy cert install --cert ./certs/ca.crt

# Preview commands without executing
owl-proxy cert install --dry-run

What it does per platform:

  • macOS: Adds to System Keychain via security add-trusted-cert
  • Linux (Debian/Ubuntu): Copies to /usr/local/share/ca-certificates/ + update-ca-certificates
  • Linux (RHEL/Fedora): Copies to /etc/pki/ca-trust/source/anchors/ + update-ca-trust
  • Windows: Uses certutil -addstore ROOT

Use exported certs on another machine

# Copy the bundle to the target machine, then:
owl-proxy server --ca-cert ./certs/ca.crt --ca-key ./certs/ca.key --auth user:pass
owl-proxy client --ca-cert ./certs/ca.crt --ca-key ./certs/ca.key --remote http://server:8443

Other cert commands

owl-proxy cert info              # Show CA details (CN, expiry, fingerprint)
owl-proxy cert uninstall         # Remove CA from OS trust store

Modes

Server

Run on any machine (Raspberry Pi, VPS, cloud VM, etc.) as a proxy server:

owl-proxy server --host 0.0.0.0 --port 8443 --auth user:pass
owl-proxy server --auth-token my-secret-token
owl-proxy server --no-auth                        # no auth (trusted LAN only)

Client

Run locally as a MITM proxy. Intercepts HTTPS with dynamic per-domain certificates:

# Direct mode — fetches URLs itself (no remote server needed)
owl-proxy client --direct --port 8080

# Remote mode — forwards through an Owl Proxy server
owl-proxy client --remote http://my-server:8443 --auth user:pass --port 8080

# Serve a PAC file for browser auto-configuration
owl-proxy client --direct --pac

Browser Configuration

To use the proxy with a browser, configure it to use the client's address:

System proxy (all browsers):

  • macOS: System Settings > Network > Wi-Fi > Details > Proxies > Web Proxy (HTTP) and Secure Web Proxy (HTTPS) — set to 127.0.0.1 port 8080
  • Windows: Settings > Network & Internet > Proxy > Manual proxy — set to 127.0.0.1:8080
  • Linux (GNOME): Settings > Network > Network Proxy > Manual — set HTTP and HTTPS to 127.0.0.1 port 8080

Firefox (independent proxy settings): Settings > General > Network Settings > Manual proxy configuration — set HTTP Proxy to 127.0.0.1, Port 8080, check "Also use this proxy for HTTPS"

With PAC file (auto-configuration): Start the client with --pac, then point your browser's auto-config URL to:

http://127.0.0.1:8080/proxy.pac

Test with curl:

# HTTP
curl --proxy http://127.0.0.1:8080 http://httpbin.org/ip

# HTTPS (using the CA cert)
curl --proxy http://127.0.0.1:8080 --cacert ~/.owl-proxy/ca.crt https://httpbin.org/ip

Configuration

Settings can be provided via CLI flags, environment variables, or both:

Environment Variable Description
OWL_PROXY_HOST Server bind address
OWL_PROXY_PORT Server bind port
OWL_PROXY_USERNAME Auth username
OWL_PROXY_PASSWORD Auth password
OWL_PROXY_TOKEN Bearer token
OWL_PROXY_TIMEOUT Request timeout (seconds)
OWL_CLIENT_HOST Client listen address
OWL_CLIENT_PORT Client listen port
OWL_REMOTE_SERVER Remote server URL

Data is stored in ~/.owl-proxy/ by default (respects XDG_DATA_HOME).

Security

  • The CA private key (ca.key) can sign certificates for any domain — keep it secure
  • Use chmod 600 on ca.key (done automatically by cert generate and cert export)
  • Always use --auth in production to prevent unauthorized proxy access
  • SSRF protection blocks requests to localhost and private IP ranges

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

owl_proxy-0.1.4.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

owl_proxy-0.1.4-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file owl_proxy-0.1.4.tar.gz.

File metadata

  • Download URL: owl_proxy-0.1.4.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for owl_proxy-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2a9dea7bbccf799dc80e656fb5ae2f974e478cb03972378b87180072c84528e1
MD5 d3aab950370bf7b66ac0aa7267ec21b8
BLAKE2b-256 06c4a2f4a9f69bae7f395523afabc609f2618da18b1e7f61efe370973d8a0bf2

See more details on using hashes here.

File details

Details for the file owl_proxy-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: owl_proxy-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for owl_proxy-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2a5a2a2c5bde9bfdc61288d37077b20daf52112a747a1d3da352bd1a9f8e0340
MD5 c6f04847ebd13e0195a6a5d2f67a787f
BLAKE2b-256 cfda84a6f532d9c3762d7c22179b68a60851731ea5534d098b4e77c5a64555c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page