我试图在本地主机上的Squirrelmail(serat.16tkja.biz)上添加自签名证书,因此它不会显示NOT SECURED或带有删除线的红色HTTPS。我已按照此site中的教程创建了证书,并将其导入浏览器(Chrome和Mozzila),但无济于事。证书名称为 server.crt 。
这是 /etc/apache2/sites-available/000-default.conf
中的配置文件<VirtualHost *:80>
ServerName serat.16tkja.biz
ServerAlias www.serat.16tkja.biz
DocumentRoot /usr/share/squirrelmail
Redirect permanent /usr/share/squirrelmail https://serat.16tkja.biz </VirtualHost>
这是 default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@16tkja.biz
ServerName serat.16tkja.biz
DocumentRoot /usr/share/squirrelmail
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
#SSLCACertificatePath /etc/ssl/certs/
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" \ ssl-unclean-shutdown
</VirtualHost>
这是 /etc/squirrelmail/apache.conf
<VirtualHost *:80>
DocumentRoot /usr/share/squirrelmail
ServerName serat.16tkja.biz
</VirtualHost>
证书安装成功,它显示在浏览器证书列表中。 Screenshot of Certificate