Repository navigation
how elevate the service? #847
|
Hello, thanks for the nice project, i know that i have to execute the service as administrator to install the certificate so o think that i miss the right way to elevate the service as admin user, can you tell me the right way to elevate a service? thanks for discussion and the project p.s. witth ssl decode = false also the https "works", but will never called (on https) the OnBeforeResponse Task so i think that ssl deocde should be = true, but in this case Firefox gove back SEC_ERROR_BAD_SIGNATURE so i think to don't have the certificate installed |
Replies: 2 comments
|
well, after some random command and reboot OnBeforeResponse works this (to add the certificate): any idea? |
|
You usually don't need to elevate the running service. Install/trust the root once (as admin), then the service can just load that same cert. For a Windows service: // one-time setup (run elevated / installer), then persist the pfx
proxyServer.CertificateManager.CertificateEngine = CertificateEngine.BouncyCastle;
proxyServer.CertificateManager.CreateRootCertificate(true);
proxyServer.CertificateManager.TrustRootCertificateAsAdmin(); // Local Machine storeThen on service start, just load it (don't recreate every time): proxyServer.CertificateManager.RootCertificate =
proxyServer.CertificateManager.LoadRootCertificate();Notes that match your symptoms:
Closing ? your reboot likely picked up the machine-store trust. Reopen if Firefox still complains after importing the root there. |
You usually don't need to elevate the running service. Install/trust the root once (as admin), then the service can just load that same cert.
For a Windows service:
Then on service start, just load it (don't recreate every time):
Notes that match your symptoms:
LocalSystemis fine; the importa…