Fiddler之makecert.exe提示Failed to acquire a security provider from issuer's centificate问题解决

使用Fiddler抓包https时会发生这个问题,最初碰到这个问题的时候始终弄不清楚什么原因,有的机器可以,有的机器就不行。
经过一番google之后,才终于解决这个问题,下面说一下解决的思路。最初的错误提示如下图:

![错误提示](https://img-blog.csdn.net/20150618195707682)
首先删除当前的根证书,删除的步骤如下(这个步骤从网上拷贝了,见后文参考链接):
1. Go to Start/Run and run "MMC"
2. Go to File..Add/Remove Snap-in
3. Click Add
4. Select Certificates and click Add
5. Selet My User Account and click finish
6. Close the dialogs and you will be in the certificates snap-in
7. Go to Certificates-Current User/Personal/Certificates
8. Right click on DO_NOT_TRUST_FiddlerRoot and delete it.

When you restart Fiddler and hit your first HTTPS site it will re-create the certificate and fiddler should work.    

接下来重新启动Fiddler,再打开一个https的网站试试,这时候有可能makecert会提示另一个错误:
Can’t create the key of the subject (‘JoeSoft’)

在网上搜索这个错误的参考文章,发现说是权限的问题,我检查了%appdata%\Microsoft\Crypto\RSA\S-1-5-21-452922241-2776708937-1870220006-1000路径的权限,发现没有问题,在使用ProcessExplorer监控makecert.exe后发现,makecert会尝试写入一个文件:

C:\Users\user\AppData\Roaming\Microsoft\Crypto\RSA\S-1-5-21-3753638101-336018595-2945602125-1000\7b90a71bfc56f2582e916a51aed6df9a_8d239c71-c713-4d56-8ddb-15fe7cecf805

而这个文件已经存在了,于是我将这个文件改为其他名字,再次运行Fiddler,进入:
Tools->Fiddler Options->HTTPS->勾选Decrypt HTTPS traffic。
没有再提示那个can’t create的错误,说明已经成功了。然后打开一个https站点试试,成功解析https请求,大功告成!

总结一下,出现那个错误,有可能是Fiddler根证书损坏引起的,删除根证书后,Fiddler会尝试创建新的根证书,但是因为RSA目录下文件已存在,导致无法创建。因此其实要删除根证书和对应的文件才行了。

参考网址(需要跳墙):
1. http://houseofderek.blogspot.com/2009/07/problem-using-fiddler-to-monitor-ssl.html
2. http://nerdwords.blogspot.com/2008/01/makecertexe-error-can-create-key-of.html

你可能感兴趣的:(Network)