配置nginx的ssl证书出现错误error:0906D06C PEM_read_bio:no start line

2022-02-11 10:06:25 浏览数 (1)

配置nginx的ssl证书出现错误nginx: [emerg] cannot load certificate key "/etc/nginx/cert/server.key": PEM_read_bio_PrivateKey() failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: ANY PRIVATE KEY)

nginx: configuration file /etc/nginx/nginx.conf test failed 在使用nginx配置ssl证书时 测试nginx配置输入 nginx -t出现如下错误

代码语言:javascript复制
nginx: [emerg] cannot load certificate key "/etc/nginx/cert/server.key": PEM_read_bio_PrivateKey() failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: ANY PRIVATE KEY)
nginx: configuration file /etc/nginx/nginx.conf test failed

是从腾讯云上申请的证书

应该是秘钥文件编码不对,将.key文件保存成UTF8格式即可

参考链接

0 人点赞