3

I am building app with Angular 6 and I want this app to work offline and I am using Angular 6 with Service Worker and I want to host this app in local server with IIS but I do not have HTTPS cert.

What can I do to make service worker work without HTTPS? The app must work on Android, iPhone and Windows.

2
  • See here. stackoverflow.com/questions/34160509/… Commented Sep 13, 2018 at 9:48
  • hello David,thank for your response but this answer is for testing.but i want to make this work for productions Commented Sep 13, 2018 at 10:01

1 Answer 1

2

You cannot make it work without https. Having your site served over HTTPS is a requirement to enable service workers (apart from http://localhost and http://127.x.X.X).

You definitely need a valid, trusted SSL certificate if you want it to run on all platforms on production. On windows, I think there are some Chrome options to bypass that, but this would still be only for testing

Edit

You can add certificates in IIS. It might not be a trusted one, but you can manually install and trust that certificate on your devices. This is a manual process valid only for development.

As pointed by @Benjamin if all your users are on your same company network, then you can deploy that certificate on all machines (and phones) and it should work.

Sign up to request clarification or add additional context in comments.

13 Comments

or can i make my app work offline without service worker is there any way
I edited my answer. Also, you cannot really have your web app work offline on your device without PWA, unless your turn it into a hybry app using cordova.
You don't say in what environment you are working, e.g., your home, a business etc. But you can generate self-signed certificates that your machines trust and deploy thos. That is common in company internal networks.
iam working in company and the app must work in company server
@mhdsaeedshamborsh Yes, but about the users? Are they all company users, using the company network?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.