Webpack-dev-server证书已过期?

时间:2016-03-27 22:26:56

标签: https ssl-certificate webpack webpack-dev-server

在我的webpack.config.js文件中,我添加了https配置:

devServer: {
    historyApiFallback: true,
    contentBase: './',
    https: true
}

然后,当我导航到https://localhost:8080/

时,我收到错误消息
Your connection is not private

Attackers might be trying to steal your information from localhost (for example, passwords, messages, or credit cards). NET::ERR_CERT_AUTHORITY_INVALID
Subject: webpack
Issuer: webpack
Expires on: Dec 10, 2015
Current date: Mar 27, 2016
PEM encoded chain: -----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE----

看来webpack的证书已过期。我是否错误配置了什么?或者我误解了SSL?

我正在使用

"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.1"

1 个答案:

答案 0 :(得分:2)

修改

正如Markus在评论中指出的那样,webpack-dev-server自2.5.0版开始自动生成证书。

OLD ANSWER:

问题是webpack-dev-server的自签名证书已过期。这已在#436中修复。