I need to serve a vue application over HTTPS while doing local development.
The application is being served with: npm run serve
which runs: vue-cli-service serve
I have tried to create a vue.config.js
file and add the following to it:
module.exports = {
devServer: {
port: 8080,
https: true,
}
}
This results in console errors in Chrome v75 such as the following: GET https://192.168.0.71:8080/sockjs-node/info?t=1564339649757 net::ERR_CERT_AUTHORITY_INVALID
I'm guessing this is Chrome saying that the certificate being used when setting https
to true
isn't from a valid CA (maybe it's some sort of self signed thing going on in the background?)
How can I get around this? Is generating certificates via "Let's Encrypt" probably the way to go?
On another note, I have also generated a root CA private key using openssl genrsa -des3 -out rootCA.key 2048
and a self signed certificate using openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
, but I'm not sure how to tell the vue-cli-service
to try and use these. However, if self signed certificates result in ERR_CERT_AUTHORITY_INVALID
errors in Chrome, then there isn't much point pursuing this route
https://192.168.0.71:8080/
in your browser and add an exemption for the invalid cert. – Bootyminica --domains '*.foo.com'
(in my case i needed the wildcard), and added it to my keychain. – Dingle