Mitmproxy/Charles/Proxyman如何统一根证书

【Charles】移植上台PC的证书我提到了Charles可以使用Proxyman的证书,
现在我又用到了mitmproxy,如何让mitmproxy使用和Charles/Proxyman一样的证书,实现手机装一个证书3个抓包软件都能抓包?

Proxyman导出的.p12证书可以导入到Charles,那.p12如何导入到mitmproxy呢?

mitmproxy官网有提到如何生成并使用自定义证书
https://docs.mitmproxy.org/stable/concepts-certificates/#using-a-custom-server-certificate

~/.mitmproxy是mitmproxy默认存放证书的地方,打开会发现有好几个证书
在这里插入图片描述
依据官网的说辞,

By default, mitmproxy will use ~/.mitmproxy/mitmproxy-ca.pem as the certificate authority to generate certificates for all domains for which no custom certificate is provided (see above). You can use your own certificate authority by passing the --set confdir=DIRECTORY option to mitmproxy. Mitmproxy will then look for mitmproxy-ca.pem in the specified directory. If no such file exists, it will be generated automatically.

我们只需要在新目录(比如~/.mitmproxy_custom)中放一个自己的.pem证书(需要重命名为mitmproxy-ca.pem),然后以mitmproxy --set confdir=~/.mitmproxy_custom启动,mitmproxy就会自动生成其他的证书。

自己的.pem证书从哪里来,前面Charles/Proxyman我们用的是.p12证书,可以转化一下openssl pkcs12 -in mitmproxy-ca.p12 -out mitmproxy-ca.pem -nodes

总结

新建目录~/.mitmproxy_custom
Proxyman.p12证书放进去并重命名为mitmproxy-ca.p12
转为pem证书:openssl pkcs12 -in mitmproxy-ca.p12 -out mitmproxy-ca.pem -nodes
启动mitmproxy:mitmproxy --set confdir=~/.mitmproxy_custom

如此mitmproxy/Charles/Proxyman的根证书就统一了,手机只需装1个证书,3个抓包软件都能抓包。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值