我的Web应用程序是否需要使用Firebase Cloud Messaging的SSL才能使Web正常工作? [英] Does my web application require SSL for Firebase Cloud Messaging for Web to work?

查看:213
本文介绍了我的Web应用程序是否需要使用Firebase Cloud Messaging的SSL才能使Web正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Firebase Cloud Messaging for Web,

1.我的web应用程序域是否仍然需要SSL?
2.或者只有service worker.js需要一个SSL网站?如果是这样,我可以在SSL站点上托管服务工作者,但将我的Web应用程序保留在非SSL站点上吗?



任何反馈意见都非常感谢。



谢谢,

克里斯蒂娜 使用

服务人员必须满足以下条件:


注册服务工作者的网站必须注册一个服务
工作者托管

这意味着注册服务工作者的站点必须在HTTPS上,服务工作者必须在结果是通过HTTPS提供的。



(有一个未来的API来解决这个问题,但有它自己的复杂性 - 外部提取



一个常见的方法是在SSL上托管一个仅用于推送和redi的网站或者作为iframe嵌入。



这里的警告是重定向的用户体验很差,并且不能保证iframe方法在将来可以工作。
$ b 通常,考虑到需要HTTPS的新API的数量,我强烈建议检查让加密免费的TLS证书或尝试像 CloudFlare 这样的服务给你HTTPS。


With Firebase Cloud Messaging for Web,
1. Does my web application domain still require SSL?
2. Or only the service worker.js needs to be on an SSL site? if so, can I host the service worker on an SSL site but keep my web application on a non-SSL site?

Any feedback is much appreciated.

Thank you,
Christina

解决方案

To use a service worker the following condition must be met:

The web site registering the service worker MUST be registering a service worker hosted on the same origin.

This means the site registering the service worker must on on HTTPS and the service worker, which has to be on the same origin, will be served over HTTPS as a result.

(There is a future API to get around this but has it's own complications - Foreign Fetch)

One common way around this is to host a website on SSL that is solely used for push and either redirect to this page OR embed as an iframe.

The caveat here is a poor user experience with the redirect and there is no guarantee that the iframe approach will work in the future.

Generally, given the number of new APIs that require HTTPS, I'd strongly recommend checking out Lets Encrypt for free TLS certificates OR trying out a service like CloudFlare which will give you HTTPS.

这篇关于我的Web应用程序是否需要使用Firebase Cloud Messaging的SSL才能使Web正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆