Progressive Web App on a hosted UWP app does not work with HTTPS (Self-Signed)

一个人想着一个人 提交于 2020-03-05 03:03:54

问题


A PWA Angular App hosted on IIS (HTTPS binding with Self-Signed cert) which is being accessed by an UWP app (Hosted UWP: just a UWP shell pointing to the PWA App).

When the package.appxmanifest configurations such as StartPage and Content URIs are pointing to the PWA with HTTP scheme it works well (Except of course the Service Worker registration throws a an error since HTTPS is a requirement). However, when I update the URLs to point to HTTPS the UWP shows only a blank white screen with no errors (on the Javascript Console of VS2017 while debugging the UWP).

NOTE: Accessing the PWA using HTTPS works fine from the browser. FYI, using a self-signed certificate.

In short:
PWA+BROWSER+(HTTP OR HTTPS) => OK
PWA+UWP+HTTP => OK
PWA+UWP+HTTPS (Self-Signed) => NG


回答1:


Common constraints while developing PWA-UWP:

  • Min Windows 10 Version: 1809 (Service Worker supported since for EdgeHTML WebView)
  • Install SSL certificate on client devices (In case of self signed)
  • App URL must start with: https://<DomainName> (IP address does not work)
  • Client devices must have Developer Mode enabled (must allow Sideloaded apps)

WARNING: If you are planning the following Visual Studio template to create UWP - PWA: Note that Application URL should be known and configured in package.appxmanifest at the time of building the application. In our case this was not possible since we were building an On-Premise PWA.

However, In case the App URL is fixed then you can use the full power of WinJs APIs. The best part about that is the WinJs API access code can be written in your PWA, hence your UWP project is just a shell with 0 code.



来源:https://stackoverflow.com/questions/59693730/progressive-web-app-on-a-hosted-uwp-app-does-not-work-with-https-self-signed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!