Arch Linuxでmimproxy証明書を設定する方法は?

Arch Linuxでmimproxy証明書を設定する方法は?

証明書を構成する手順は何ですか?ミートプロシーArch Linuxでは?

ブラウザでmitm.itを開くと、Linuxに適用される次の手順が表示されますが、Ubuntu / Debianに固有のものです。

mv mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/mitmproxy.crt
sudo update-ca-certificates

Arch Linuxのレシピを見つけましたここ:

After installing mitmproxy run it (just type mitmproxy) in a terminal session and quit.
This will create the necessaries certificates files at ~/.mitmproxy.

Extract the certificate to .crt format:
openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt

Trust the certificate into CA:
sudo trust anchor ca.crt

Run the mitmproxy again

Open another terminal session and set the proxy:

export http_proxy='http://localhost:8080'
export https_proxy='http://localhost:8080'

Run a curl to an https site and it should work:
curl https://www.google.com

実行する前に、その方法が適切であることを確認したいと思います。変更を元に戻す方法も気になります。不要になったmitmproxy証明書を「信頼しない」方法はありますか?それともインストールされたままにしておくのは安全ですか?

ベストアンサー1

はい、これは良い方法です。実際に証明書を変換する必要なく直接使用することができます~/.mitmproxy/mitmproxy-ca-cert.cer

証明書を信頼しない場合は、次のガイドラインを参照してくださいman trust

ANCHOR
       Store or remove trust anchors.

           $ trust anchor /path/to/certificate.crt
           $ trust anchor --remove /path/to/certificate.crt
           $ trust anchor --remove "pkcs11:id=%AA%BB%CC%DD%EE;type=cert"

       Store or remove trust anchors in the trust policy store. These are usually root certificate authorities.

       Specify either the --store or --remove operations. If no operation is specified then --store is assumed.

おすすめ記事