Thursday 18 March 2021

Unable to find Root certificate Error in Fiddler

 Today, I tried to install Fiddler in one of the Virtual machine. Installation went well without any errors. When I tried to configure fiddler to decrypt https requests, it was not able to create the intercept certificates. 

I opened the fiddler logs tab on the right hand side and saw an error that getRootCertificate()call failed. Also in the initial lines of log, I found that Certmaker.dll is missing from the installation. I fixed the certmaker dll by copying the dll file from another VM where fiddler installed. This removes that line from the log but still not able to generate root certificate. Even the export the root certificate to Desktop failed. 

I tried opening fiddler as Administrator, disabled anti virus, looked at the certstore, but still getting the below error from fiddler



04:41:29:1927 !ERROR: Failed to generate Certificate using CertEnroll. System.Reflection.TargetInvocationException Exception has been thrown by the target of an invocation.

 < CertEnroll::CX509PrivateKey::Create: The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation. 0x80090345 (-2146892987 SEC_E_DELEGATION_REQUIRED)

Then after spending time on stack overflow and google the solution is with a registry key. Here is the fix :

Add the keyword "ProtectionPolicy" with DWord value as 1 in the below Location in the registry
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Protect\Providers\df9d8cd0-1501-11d1-8c7a-00c04fc297eb]

Then I am able to trust the root certificate and https decryption worked well. 

Shrinking the size of Oracle Virtual Box

First, zero fill your virtual disk. Boot the VM and run: sudo dd if=/dev/zero of=/bigemptyfile bs=4096k status=progress sudo rm -f /bigempty...