title: Error during service worker registration: DOMException: Failed to register a ServiceWorker for scope.An SSL certificate error occurred
body: <p>I'm trying to configure my apache to run react app. It runs on localhost. However I want to redirect http to https. When I do that service-worker.js doesnt work. I'm getting DOM Exception. I have used SSL certificate also</p>
  
  <p>service-worker.js</p>
  
  <pre><code>importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
  
  importScripts(
     "/precache-manifest.7167b3346c21d4ebe11be4972eadad7c.js"
  );
  
  self.addEventListener('message', (event) =&gt; {
    if (event.data &amp;&amp; event.data.type === 'SKIP_WAITING') {
  self.skipWaiting();
    }
  });
  
  workbox.core.clientsClaim();
  
  self.__precacheManifest = [].concat(self.__precacheManifest || []);
  workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
  
  workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), {
  
    blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/],
  });
  </code></pre>
  
  <p>This is my Apache configuration</p>
  
  <p>The host where my app is running</p>
  
  <pre><code>&lt;VirtualHost *:81&gt;
  ProxyPreserveHost On
  ServerName 10.177.218.172
  RemoteIPHeader X-Client-IP
  ErrorLog C:\APACHE\Apache24\logs\New_error.log
  CustomLog C:\APACHE\Apache24\logs\New_error.log combined
  LogLevel debug
  ShibCompatValidUser Off
  DocumentRoot "${SRVROOT}/Example"
  &lt;/VirtualHost&gt;  
  </code></pre>
  
  <p>Using reverse proxy to get https    </p>
  
  <pre><code>&lt;VirtualHost *:91&gt;
  
  SSLEngine On
  SSLProxyEngine On 
  SSLCertificateFile "root.crt"
  SSLCertificateKeyFile  "server.key"
  SSLHonorCipherOrder on
  SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 
  SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA
  SSLProxyVerify none
  SSLProxyCheckPeerCN off
  SSLProxyCheckPeerName off
  
  RequestHeader set X-Forwarded-Proto "https"
  RequestHeader set X-Forwarded-Port "91"
  RequestHeader set REMOTE_ADDR "10.217.12.12"
  RequestHeader set HOST "10.217.12.12:91"
  
  
  &lt;Location /&gt;
  
      ProxyPass "http://10.217.12.12:81/"
      ProxyPassReverse "http://10.217.12.12/"
  
  &lt;/Location&gt;
  &lt;/VirtualHost&gt; 
  </code></pre>
  
  <p>I get this error when I run 10.217.12.12:91</p>
  
  <pre><code>serviceWorker.js:97 Error during service worker registration: DOMException: Failed to register a 
  ServiceWorker for scope ('https://10.217.12.12:91/') with script ('https://10.217.12.12:91/service- 
  worker.js'): An SSL certificate error occurred when fetching the script.
  </code></pre>
  
  <p>Anyone has an idea to fix this?</p>