Answer the question
In order to leave comments, you need to log in
How to make an SSL certificate on localhost for browserSync?
I generate a certificate and a key with the following script:
#!/bin/bash
CWD="$1"
HOST="$2"
key="${CWD}/${HOST}.key"
crt="${CWD}/${HOST}.crt"
rm -f "${key}" "${crt}"
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout "${key}" -out "${crt}" -subj "/[email protected]${HOST}/CN=${HOST}/OU=${HOST}/O=${HOST}/L=${HOST}/ST=${HOST}/C=ru"
browserSync({
browser: "google-chrome",
server: {
baseDir: "./build"
},
port: 3030,
open: true,
notify: true,
https: {
key: options.browserSync.key,
cert: options.browserSync.crt
}
});
Answer the question
In order to leave comments, you need to log in
And you, sorry, what did you expect to see? A self-generated certificate is not trusted. Add it first to the trusted root centers - and try later, maybe it will work.
By the way, the text of the error is not visible, I just assumed that it was CERT_AUTHORITY_INVALID
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question