Вопрос 1:
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080
Вопрос 2:
openssl genrsa -out cert.key 8192
openssl req -new -x509 -key cert.key -out cert.crt
пример Common Name: *.google.com
cat cert.key cert.crt > cert.pem
mitmproxy --cert=cert.pem