Fiddlercore App not running as Service (Network Service / Local Service / Local Account)

128 views
Skip to first unread message

Nitish Kumar

unread,
Aug 28, 2017, 6:26:04 AM8/28/17
to Fiddler
Dear Eric ,Friends  

I have made an App using Fiddlercore. Have also made a service for the same.Imported FiddlerCoreRoot.cer into certificate store into Local Computer under Trusted CAs.

Everything works fine till the time I create service as a named user say my user account on the system. The problem comes when I change the service to any of these (Network Service / Local Service / Local Account). The fiddler stops working for HTTPS sites. 

I understand that certificate should be imported and the service should be of same user. But the App in question has to be run only with service though these 3 user accounts...cant run service from any other user account.

Please guide on how can we make Fiddlercore work on HTTPS sites using service created as - Network Service / Local Service / Local Account.

Appreciate Quick Help.

Thanks. 

Eric Lawrence

unread,
Aug 28, 2017, 5:24:10 PM8/28/17
to Fiddler
What does "stops working" mean exactly?

Are there any error messages coming into your event handlers for these events?

   Fiddler.FiddlerApplication.OnNotification
   Fiddler.FiddlerApplication.Log.OnLogString
 

Nitish Kumar

unread,
Aug 30, 2017, 9:27:41 AM8/30/17
to Fiddler
Stop Working means that HTTPS sites dont open & throw error as Invalid Certificate. Whereas HTTP keeps working good. 

When I switch back the account of service from (Network Service / Local Service / Local Account) to the user account (like my account) , HTTPS sites start opening back again.

I have done the Import of certificate (FiddlerCoreRoot.cer) on Local Computer which means that this certificate should be valid to all the accounts on the system. However , it seams that its not valid on these 3 Accounts - (Network Service / Local Service / Local Account). 

Is there a way to Import certificate for these 3 accounts or point FiddlerCore to use the certificate from a specified location on C Drive. 

Or any other recommendation. Thanks for help !!!

Eric Lawrence

unread,
Aug 30, 2017, 12:28:43 PM8/30/17
to Fiddler
Please be specific about the exact error code shown by the client where you say "throw error as Invalid Certificate".

Nitish Kumar

unread,
Aug 31, 2017, 11:28:43 AM8/31/17
to Fiddler
Hi Eric

Sorry , we are new to C# coding. We have used this code to enable Logging in our C# code.

private bool StartLoader()
        {
 FiddlerApplication.OnNotification += delegate(object sender, NotificationEventArgs oNEA)
            {
                this.EventLog.WriteEntry("** NotifyUser: " + oNEA.NotifyString);
            };
            FiddlerApplication.Log.OnLogString += delegate(object sender, LogEventArgs oLEA)
            {
                this.EventLog.WriteEntry("** LogString: " + oLEA.LogString);
            };


After that we ran our exe as a Network Service & seen the Events in Windows Event Viewers.
We opened https://www.amazon.in. The site did not open...Error on Browser as NET::ERR_CERT_AUTHORITY_INVALID
Event Viewer showed this :
In OnStart
** LogString: Fiddler ICertificateProvider v4.5.0.1 loaded.
    fiddler.certmaker.bc.Debug:    False
    ObjectID:            0x35a55e0
** LogString: [Fiddler] No HTTPS request was received from (chrome:7952) new client socket, port 12227.
** LogString: [Fiddler] No HTTPS request was received from (chrome:7952) new client socket, port 12228.
** LogString: [Fiddler] No HTTPS request was received from (chrome:7952) new client socket, port 12229.
** LogString: [Fiddler] No HTTPS request was received from (chrome:7952) new client socket, port 12223.



After that we opened an HTTP site : http://www.indiashopps.com. This opened
Event Viewer showed below :
** LogString: [Fiddler] No HTTPS request was received from (chrome:7952) new client socket, port 12503.
** LogString: [Fiddler] No HTTPS request was received from (chrome:7952) new client socket, port 12501.

There are lot many same kind of entries. Just 1 entry which stand out in whole lot is :
** LogString: !SecureClientPipeDirect failed: System.IO.IOException Authentication failed because the remote party has closed the transport stream. for pipe (CN=*.ws.microsoft.com, O=DO_NOT_TRUST_BC, OU=Created by http://www.fiddler2.com)

Hope this gives you some idea on whats wrong. Or you can give us a small C# code which we can put in exe file which will capture all errors.

Appreciate your help.

Attached few screenshots for your reference :






Regards,



Auto Generated Inline Image 1
Auto Generated Inline Image 2

Eric Lawrence

unread,
Aug 31, 2017, 6:40:21 PM8/31/17
to Fiddler
CERT_AUTHORITY_INVALID means that the certificate used by the FiddlerCore process isn't trusted by the user or system running the Web Browser.

It looks like you're using BouncyCastle for certificate generation? Keep in mind that you must take care if you want your FiddlerCore application to use the same root certificate each time it's run. See https://weblog.west-wind.com/posts/2014/jul/29/using-fiddlercore-to-capture-http-requests-with-net#Gotcha:FiddlerCoreCertificatesdon’tstickbyDefault for details.

Eric Lawrence

unread,
Aug 31, 2017, 6:41:34 PM8/31/17
to Fiddler
(Scroll to the "Gotcha: FiddlerCore Certificates don’t stick by Default" section of that blog)

Reply all
Reply to author
Forward
0 new messages