mitmproxy-macos
raw JSON → 0.12.9 verified Fri May 01 auth: no python
Native macOS TLS support for mitmproxy (mitmproxy-rs). This library provides the low-level TLS API for mitmproxy on macOS, leveraging Apple's Security Framework. Version 0.12.9 is the latest, with monthly releases. Compatible with Python >=3.12.
pip install mitmproxy-macos Common errors
error ModuleNotFoundError: No module named 'mitmproxy_macos' ↓
cause The package was not installed or installed with an older name (e.g., `mitmproxy-macos` with hyphen).
fix
Install using pip:
pip install mitmproxy-macos (note the hyphen in the package name, but import uses underscore). error ImportError: cannot import name 'TLS' from 'mitmproxy_macos' ↓
cause TLS is not a public symbol; the correct class is TLSLayer.
fix
Use
from mitmproxy_macos import TLSLayer instead. Warnings
breaking Requires Python >=3.12; not compatible with earlier versions. ↓
fix Upgrade Python to 3.12 or later.
deprecated The module `mitmproxy_macos.tls` was deprecated in 0.12.5; use `mitmproxy_macos.TLSLayer` instead. ↓
fix Replace `from mitmproxy_macos.tls import TLSLayer` with `from mitmproxy_macos import TLSLayer`.
gotcha Library only works on macOS; importing on other platforms raises an ImportError. ↓
fix Use conditional import or run only on macOS.
Imports
- TLSLayer wrong
from mitmproxy_macos import TLScorrectfrom mitmproxy_macos import TLSLayer
Quickstart
import os
from mitmproxy_macos import TLSLayer
# The library is meant to be used as part of mitmproxy.
# Below is a snippet to verify the import works.
tls_layer = TLSLayer()
print('TLSLayer initialized successfully')