Google Chrome-无法打开链接ERR_CERT_COMMON_NAME_INVALID

时间:2018-06-28 11:43:13

标签: apache google-chrome wamp chromium httpd.conf

在Google Chrome浏览器中,我不断收到ERR_CERT_COMMON_NAME_INVALID。

enter image description here enter image description here

创建的证书:

C:\OpenSSL-Win..\bin>openssl genrsa -aes256 -out private.key 2048
C:\OpenSSL-Win..\bin>openssl rsa -in private.key -out private.key
C:\OpenSSL-Win..\bin>openssl req -new -x509 -sha1 -key private.key -out certificate.crt -days 36500 -config C:\OpenSSL-Win..\bin\openssl.cfg

怎么了?为什么要获得ERR_CERT_COMMON_NAME_INVALID?

1 个答案:

答案 0 :(得分:0)

有效。

enter image description here enter image description here

步骤1

A)

# openssl genrsa -out server_rootCA.key 2048
# openssl req -x509 -new -nodes -key server_rootCA.key -sha256 -days 3650 -out server_rootCA.pem

B)

# cat server_rootCA.csr.cnf
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn

[dn]
C=BE
ST=oost-vlaanderen
L=Stackoverflow
O=Stackoverflow
OU=local_RootCA
emailAddress=helpdesk@Stackoverflow.com
CN = localhost

# cat v3.ext 
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = localhost

C)

# openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config <( cat server_rootCA.csr.cnf )

# openssl x509 -req -in server.csr -CA server_rootCA.pem -CAkey server_rootCA.key -CAcreateserial -out server.crt -days 3650 -sha256 -extfile v3.ext

步骤2

在Apache中使用 SSLCertificateFile /etc/apache2/ssl/server.crt SSLCertificateKeyFile /etc/apache2/ssl/server.key

步骤3:

  • 将PEM添加到浏览器
  • Chromium->设置->(高级)管理证书->导入->'server_rootCA.pem'

enter image description here

enter image description here enter image description here