使用 Stripe API 的非安全网站错误

Non-secure website error using Stripe API

我使用 Stripe API 在 Node.js 中创建了一个购物车网页,当我将它部署到 Heroku 时,我遇到了一个不安全的网页错误,我的错误是:

Your connection to this site is not secure You should not enter any sensitive information on this site (for example, passwords or credit cards), because it could be stole by attackers

我可以做些什么来阻止这个,因为没有加载图像我只在 google Chrome 中遇到这个错误。在 Safari 和 Firefox 中,我什至没有收到错误,但图像不会加载。

您需要确保您的网站(或至少包含付款表格的页面)是通过 HTTPS 提供服务的。

比照。 Stripe 的文档以获取更多信息:https://stripe.com/docs/security#tls.

您可以强制您的 Heroku 应用仅在 https 上侦听。如果您使用的是 Express,可以使用 here.

中描述的解决方案来完成