大网数据广告活动
服务器运维问答

4562605504:error:0909006C:PEM routines:get_name:no start line:crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE

· 52CE 我爱测

The certificate of my website just expired, and I bought a new (free) one from AliCloud, downloaded one server.pem file and one server.key file. Then, I use openssl x509 -outform der -in server.pem -out server.crt to create the s…

问题原文

原帖链接 · SoftTimur · CC BY-SA 4.0

The certificate of my website just expired, and I bought a new (free) one from AliCloud, downloaded one server.pem file and one server.key file.

Then, I use openssl x509 -outform der -in server.pem -out server.crt to create the server.crt file. Then openssl x509 -noout -text -in server.crt returned me an error:

unable to load certificate
4562605504:error:0909006C:PEM routines:get_name:no start line:crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE

I also tried server.crt in production, it just did not work.

Does anyone know how to properly generate .crt file?

社区高分解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

Likely you shouldn't be generating anything with these openssl commands but instead should be using the server.pem file exactly as you received it.

Open the file in a text editor. If the first line of this file is:

-----BEGIN CERTIFICATE-----

Then you use it unchanged. The only thing you might need to do to it is to append any intermediate certificates, depending on your web server.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-06-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。