我已经在我的lighttpd上安装了过去的ssl密钥,并且logging了我所做的步骤,以确保我可以在将来复制它。 那么,我还没有碰到服务器一段时间,我需要创build一个新的Web服务器与lighttpd,将支持SSL。 按照我的笔记中的所有步骤,它给了我这个错误
SSL: couldn't read X509 certificate from PEM file
我不确定我在步骤中错过了什么,但如果有人可以请看看我的步骤,也许build议我错过了什么,我真的很感激。
这是我的环境
CentOS 6.4 64 bit lighttpd/1.4.35 (ssl) - a light and fast webserver
我的ssl证书来自startcom公司
这是我的步骤
生成我的csr
openssl req -new -newkey rsa:4096 -nodes -out myserver.csr -keyout myserver_privatekey.key -subj "/C=us/ST=State/L=City/O=MyCompany/OU=Productions/CN=myserver.mycompany.net"
将CSR发送到Startcom并将此ssl保存为
myserver.crt
创build最终的PEM文件
cat myserver_privatekey.key myserver.crt > myserver.pem
从startcom得到这2个文件
ca.pem sub.class1.server.ca.pem
统一这两个文件
cat ca.pem sub.class1.server.ca.pem >> ca-certs.crt
将crt和pem文件移到myssl目录
这是我的lighttpdconfiguration:
$SERVER["socket"] == "0.0.0.0:443" { ssl.engine = "enable" ssl.ca-file = "/etc/lighttpd/myssl/ca-certs.crt" ssl.pemfile = "/etc/lighttpd/myssl/myserver.pem" } $SERVER["socket"] == "[::]:443" { ssl.engine = "enable" ssl.ca-file = "/etc/lighttpd/myssl/ca-certs.crt" ssl.pemfile = "/etc/lighttpd/myssl/myserver.pem" } $HTTP["host"] =~ "^(myserver\.)?mycompany\.net$" { ssl.ca-file = "/etc/lighttpd/myssl/ca-certs.crt" ssl.pemfile = "/etc/lighttpd/myssl/myserver.pem" server.document-root = "/var/www/lighttpd/mywebsite" }
所以当我完成后,我重新启动了我的lighttpd,这是我得到的错误。
Starting lighttpd: 2015-09-20 15:58:32: (network.c.543) SSL: couldn't read X509 certificate from '/etc/lighttpd/myssl/myserver.pem'
我从来没有或没有看到过去的错误,所以我不太清楚如何从那里前进。 任何人都可以给我你的2美分,我错过了什么? 请帮忙?