Lighttpd + https安装与自签名证书

时间:2013-11-12 19:20:16

标签: ssl https openssl lighttpd self-signed

以下链接教程中的

与在lighttpd Web服务器上安装https有关。 http://www.cyberciti.biz/tips/how-to-install-ssl-lighttpd-https-configuration.html

我的问题是如何使用任何自签名证书生成器生成这些证书?我使用自签名证书进行开发..

1 个答案:

答案 0 :(得分:3)

首先生成一个键:

openssl genrsa -des3 -out testing.key 2048

如果不能将此密码用于可公开访问的Web服务器,则可以将密码留空。 (即仅限localhost)

然后生成证书签名请求:

openssl req -new -key testing.key -out testing.csr

然后生成证书:

openssl x509 -req -days 365 -in testing.csr -signkey testing.key -out testing.crt

此时您应该有3个文件:testing.keytesting.csrtesting.crt

要创建lighttpd可以使用的.pem文件,请连接您的密钥和证书:

cat testing.key testing.crt > certificate.pem

您可以将证书保存在/ etc / lighttpd / ssl或某些此类目录中。