create-react-app https localhost 安全连接失败

问题描述

我正在尝试在本地开发人员上使用 https 来创建“create-react-app”。 我使用此站点作为创建证书的教程,并让 Windows 信任它:https://zeropointdevelopment.com/how-to-get-https-working-in-windows-10-localhost-dev-environment/

这是我的 .env 文件

SSL_CRT_FILE=client-1.local.crt
SSL_KEY_FILE=client-1.local.key
HTTPS=true

这是我的 package.json

...
"scripts": {
    "start": "react-scripts start","build": "react-scripts build","test": "react-scripts test --env=jsdom","eject": "react-scripts eject"
  },...

之后,我使用

npm 启动

命令,然后转到 https://localhost:3000/

  • 在 Firefox 上我收到一个

全连接失败”错误,细节很少“错误 在连接到 localhost:3000.PR_CONNECT_RESET_ERROR 时发生

  • 在 Chrome 上我收到

连接已重置

我还查看了这篇帖子 create-react-app: how to use https instead of http?,但没有看到任何可以帮助我的内容我有 Windows 10。

有什么想法吗? 谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)