xampp localhost 的通配符 SSL 证书

xampp localhost 的通配符 SSL 证书

作为一名网络开发人员,我的计算机上本地有很多网站。我正在尝试对其进行设置,以便可以通过 HTTPS 访问它们。

这是我的 http 配置的 vhosts 部分

<VirtualHost *:80>
    ServerName test.local
    ServerAlias *.local
    VirtualDocumentRoot /home/jonathan/Sites/%-2/public_html
    CustomLog /home/jonathan/Sites/access.log vhost_combined
    ErrorLog /home/jonathan/Sites/error.log
</VirtualHost>

<VirtualHost *:443>
    ServerName test.local
    ServerAlias *.local
    VirtualDocumentRoot /home/jonathan/Sites/%-2/public_html
    CustomLog /home/jonathan/Sites/access.log vhost_combined
    ErrorLog /home/jonathan/Sites/error.log
    SSLEngine On
    SSLCertificateFile /home/jonathan/Sites/public.cert
    SSLCertificateKeyFile /home/jonathan/Sites/private.key
</VirtualHost>

我认为这很有效,因为当我去时,http://dotjs.local我会index.html从 得到服务/home/jonathan/Sites/dotjs/public_html/

如果我转到https://dotjs.local,我会收到警告,但如果我忽略它,我也会收到相同的文件。

我在获取工作证书时遇到问题。

我关注了(这个)[https://blog.celogeek.com/201209/209/how-to-create-a-self-signed-wildcard-certificate/]创建证书的指南,除了我根据我的虚拟主机配置将文件命名为 public.cert 和 private.key 。

使用以下命令创建证书时:openssl req -new -x509 -nodes -sha1 -days 3650 -key private.key > public.cert

我输入了以下内容(我隐藏了一些个人详细信息):

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:{My county}
Locality Name (eg, city) []:{My city}
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Blar
Organizational Unit Name (eg, section) []:Blar
Common Name (e.g. server FQDN or YOUR name) []:*.local
Email Address []:{My email address}

然后我将 host.perm 导入到 chromium 中,但是(重新启动后)我仍然得到以下信息:铬反应

相关内容