No ratings

Using Fiddler to capture K2 Host Server requests


Using Fiddler to capture K2 Host Server requests

This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.

This should be done for debugging purposes, i.e. when you want an easy way to redirect all K2 HostServer web traffic to go through Fiddler.


Running Fiddler with this method should only be done for debugging purposes and never on Production Systems.

There is a wide range of issues that can be debugged using these instructions, from SmartAction Notifications, K2 for SharePoint Applications and even SmartForms.


Configuring Your System to Use Fiddler for Debugging


Please follow these instructions:

  1. Download the latest copy of Fiddler using this link and install it on your K2 Server
  2. Stop the K2 Blackpearl service.
  3. Open "\K2 blackpearl\Host Server\Bin\K2HostServer.exe.Config" with a text editor.
  4. Add the following code to the <> section after editing the proxyaddress value to match your environment.

<defaultProxy enabled="true" useDefaultCredentials = "true">

    <proxy autoDetect="false" bypassonlocal="false" proxyaddress="" usesystemdefault="false" />


These values are from the Denallix core’s Fiddler config so please adjust accordingly for your environment!

To get the values for the "proxyaddress" element open Fiddler, and select Tools > Options and click on the Connections tab.

Click on the link "Copy Browser Proxy Configuration URL" and paste the link into a text editor, the contents should look as follows:

Locate the JS file and edit in a Text Editor, the contents of the file should look as follows:
function FindProxyForURL(url, host){
return 'PROXY';

You can use the IP and Port in the "proxyaddress" element.

5. Start the K2 Blackpearl Service.

6. When saving the Fiddler Trace, make sure to save it as a .saz file (Session Archive)


7. Next, open the “Customize Rules” in Fiddler, this is the FiddlerScript.

Edit the OnBeforeRequest static function in FiddlerScript and replace the ‘host name’ placeholder with your environment’s host name:

Static function OnBeforeRequest (oSession: Session) {
       if ("host-name")) {
            oSession["https-Client-Certificate"] = "C:\\temp\\EnvOwner.cer";
            oSession["https-Client-Certificate"] = "C:\\temp\\EnvContributor.cer";

Save the script

8. Open the Certificate Manager by pressing “Windows + R” and searching “certlm.msc”

9. Export the Environment Owner and Environment Contributor certs to c:\temp with the names EnvOwner.cer and EnvContributor.cerKeelan_3-1629461007124.png
  • There is no need to export the private key.
  • These files are used for the FiddlerScript to work
  • Restart Fiddler
  • Start the K2 Server


Your host server will route all web traffic through Fiddler. You can disable this by changing the enabled flag to false as indicated below, then restarting the host server.

<defaultProxy enabled="false" useDefaultCredentials = "true">

    <proxy autoDetect="false" bypassonlocal="false" proxyaddress="" usesystemdefault="false" />


Once you enable host server traffic through Fiddler you’ll start to see entries like the following:
(The following example is when K2 is getting OAuth Tokens):



If your browser is set to "Autodetect proxy settings" these settings might override the browser proxy settings (even if set to enabled=false.

Once you have completed your debugging tests, remove the 'defaultProxy' section and restart your K2 Blackpearl Server.

Labels: (3)
Version history
Last update:
‎03-15-2022 07:36 AM
Updated by: