我遵循此页创建我的SSL证书。
我已经使用openssl创建了rootCA和服务器证书。
但在铬上它显示了这一页。像在这里
下面是Openssl命令:
"[Apache install path]\bin" openssl genrsa -des3 -out rootCA.key 2048
"[Apache install path]\bin" openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 3560 -extensions v3_req -out rootCA.pem
Country Name (2 letter code) [AU]:TW
State or Province Name (full name) [Some-State]:Taiwan
Locality Name (eg, city) []:Taipei
Organization Name (eg, company) [Internet Widgits Pty Ltd]:CR
Organizational Unit Name (eg, section) []:IT section
Common Name (eg, server FQDN or YOUR name) []:localhost
Email Address []:cr@localhost
并将rootCA.pem安装到操作系统可信证书。(我的操作系统是windows 10)
然后生成CSR:
set OPENSSL_CONF=[Apache install path]\conf\openssl.cnf (This is apache default)
openssl genrsa -out server.key 2048
只有公共名称与rootCA不同,后者设置为"html_12“。
openssl req -new -key server.key -out server.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 500 -sha256 -extensions v3_req
和httpd-ssl.conf中的Apache设置:
SSLCertificateFile "D:/xampp/Apache2.2_win32/conf/server.crt"
SSLCertificateKeyFile "D:/xampp/Apache2.2_win32/conf/server.key"
在httpd-vhosts.conf中是相同的:
<VirtualHost *:80>
DocumentRoot "E:/PHP_TEST"
ServerName html_12
ErrorLog "logs/html_12M-error.log"
CustomLog "logs/html_12M-access.log" common
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLCertificateFile "D:/xampp/Apache2.2_win32/conf/server.crt"
SSLCertificateKeyFile "D:/xampp/Apache2.2_win32/conf/server.key"
SSLCACertificateFile "D:/xampp/Apache2.2_win32/conf/rootCA.pem"
</VirtualHost>
这是发生后,更新铬到61.0.3163.79,我不知道这是否与铬有关。
在我更新它之前,只需显示“您的连接不是私有的”,我可以单击“前进”继续我的工作。
我还设置了chrome://flags/#allow-insecure-localhost
,允许从本地主机加载资源的证书无效。启用
但还是有同样的问题。
我可以做任何其他事情来信任我的本地主机证书吗?
发布于 2017-10-05 01:43:23
我已经解决了这个问题。
我必须用openssl在同一个根目录下创建一个文件v3.ext
。
文件内容:
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = TW
ST = Taiwan
L = Taipei
O = CR
OU = It
CN = html_12
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1=html_12
然后执行命令行生成key & crt文件:
openssl req -new -newkey rsa:2048 -sha256 -days 3650 -nodes -x509 -keyout server.key -out server.crt -config v3.ext -extensions v3_req
然后把文件放到apache中。
它起作用了。
发布于 2018-01-19 12:00:34
如果您拥有原始证书的原始.csr和私钥,则只能通过更改openssl.conf来解决它。
将其添加到文件中:
[alt_names]
DNS.1=html_12
..。您可以再次生成证书:
openssl x509 -signkey private.key -in request.csr -req -days 365 -out cert-newcert.cer
https://stackoverflow.com/questions/46152891
复制相似问题