Doctor is end user of this application Doctor opens desktop application on his pc which is not developed by us. We provide interface to desktop application via interop dll's. Desktop application call interface and through it they call our integration exe which includes some services which sits on doctors pc. This integration exe further creates session id, validates certificate on doctors pc with our database and at last it open browser with our webapplication created in angularjs.

Now i will explain what issues we face due to this..

previously this was working because webapplication was in http and so was wcf service aka localhost service in http. Client told we cannot host webapplication in http and we had to use https. But https webapplication cannot talk to local service hosted in http , so we had to change to use https for communicating with localhost services. So we had to introduce self signed certificates. This was also working ok till last month when chrome came with policy that it will not allow localhost certificate and suddenly on browser we get error about accepting certifcate.

what does localhost service do?

a. Get access token by passing the session Id to login the application from desktop application .

b. Pass XML message to desktop application to Sign

c. Get Available Printers in the network.

d. Intimate browser close event to desktop application to close the session.

What we need to do now

Find a way to totally avoid localhost service so we need to change architecture or first come up with approach

1 Answer 1


We ran into a similar issue in the software that I work on. We ended up using the same approach as Spotify (the important part is bolded):

With the requirement to use HTTPS, a valid SSL certificate is needed to avoid browsers complaining. Spotify has worked around this problem by registering a domain (*.spotilocal.com) that merely points to But rather than connecting to the top domain, they use a wildcard domain and connect to a random subdomain each time (for example abcrjdknsa.spotilocal.com). The reason for this is to avoid the browser’s max connection limit per domain, enabling more tabs in the browser to concurrently use their API at the cost of an extra DNS lookup.

Implementing this approach requires two steps:

  1. Register a domain and purchase a certificate for it.
  2. In the installer for your local service, modify the hosts file to point the domain to

As you can see, this does not require any changes to either your client or server code, just the installer.

  • Really thanks but can you tell if you implemented in c# for equivalent code in python as mentioned in link? Commented Aug 11, 2017 at 11:35
  • 1
    @DevelopmentIsMyPassion The only code changes required are in your installer, so whatever language it is written in. I've added a bit more explanation to the answer.
    – Jack A.
    Commented Aug 11, 2017 at 22:04
  • Not good idea i think to modify host file on every computer. There are so many clients and its impossible to modify host file on all machine. I think we need to write some logic to append random name to domain Commented Aug 15, 2017 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.