Chrome (net::ERR_CERT_COMMON_NAME_INVALID) errors on SSL self-signed certificate
Spent a couple of hours trying to fix this. The following way worked for me:
Create a config file (for example req.cnf)
[req]distinguished_name = req_distinguished_namex509_extensions = v3_reqprompt = no [req_distinguished_name]C = USST = VAL = SomeCityO = MyCompanyOU = MyDivisionCN = local.com [v3_req]keyUsage = critical, digitalSignature, keyAgreementextendedKeyUsage = serverAuthsubjectAltName = @alt_names [alt_names]DNS.1 = local.comIP.1 = 127.0.0.1
and then generate a certificate and private key
openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout local.com.key -out local.com.crt -config req.cnf -sha256