↑↑↑ 点击“Linux运维技术之路”关注,总有一篇文章,触动你的心
一、概述:
客户提交一个证书给我,让帮忙把网站域名都改为HTTPS,但是当修改配置完成后,出现如下错误。
[root@localhost ssl]# usr/local/nginx/sbin/nginx -t
nginx: [emerg] PEM_read_bio_X509_AUX("/usr/local/nginx/conf/ssl/server.pem") failed (SSL: error:0906D064:PEM routines:PEM_read_bio:bad base64 decode)
nginx: configuration file usr/local/nginx/conf/nginx.conf test failed
复制
错误关键" error:0906D064:PEM routines:PEM_read_bio:bad base64 decode"
二、故障原因:
经过对关键字的排查,SSL证书公钥字符串每隔64个字符需要加一个换行,负责会提示 "error:0906D064:PEM routines:PEM_read_bio:bad base64 decode"
三、解决方法:
出现上述问题的原因,主要是由于客户提交给我的证书不是文件,直接用微信复制给我的内容,现在一般阿里云申请的证书自动生成的文件,直接使用文件就会避免出现这样的错误。
好了,出现错误还是要解决的。
首先,想办法把证书内容转换为每隔64个字符,加一个换行。
1、可以使用如下命令
[root@dataX ~]# fold --help
Usage: fold [OPTION]... [FILE]...
Wrap input lines in each FILE (standard input by default), writing to
standard output.
Mandatory arguments to long options are mandatory for short options too.
-b, --bytes count bytes rather than columns
-c, --characters count characters rather than columns
-s, --spaces break at spaces
-w, --width=WIDTH use WIDTH columns instead of 80
--help display this help and exit
--version output version information and exit
复制
2、执行语句如下
[root@localhost ssl]# /usr/local/nginx/sbin/nginx -t
nginx: [emerg] PEM_read_bio_X509_AUX(“/usr/local/nginx/conf/ssl/server.pem”) failed (SSL: error:0906D064:PEM routines:PEM_read_bio:bad base64 decode)
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
[root@localhost ssl]# fold -w 64 server.pem > server.pem1
[root@localhost ssl]# \cp -rf server.pem1 server.pem
[root@localhost ssl]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost ssl]# /usr/local/nginx/sbin/nginx -s reload
复制
爱运维^_^爱分享
点个在看少背锅 👇
文章转载自Linux运维技术之路,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
2025年4月中国数据库流行度排行榜:OB高分复登顶,崖山稳驭撼十强
墨天轮编辑部
2503次阅读
2025-04-09 15:33:27
数据库国产化替代深化:DBA的机遇与挑战
代晓磊
1161次阅读
2025-04-27 16:53:22
2025年3月国产数据库中标情况一览:TDSQL大单622万、GaussDB大单581万……
通讯员
845次阅读
2025-04-10 15:35:48
2025年4月国产数据库中标情况一览:4个千万元级项目,GaussDB与OceanBase大放异彩!
通讯员
659次阅读
2025-04-30 15:24:06
数据库,没有关税却有壁垒
多明戈教你玩狼人杀
577次阅读
2025-04-11 09:38:42
天津市政府数据库框采结果公布,7家数据库产品入选!
通讯员
561次阅读
2025-04-10 12:32:35
国产数据库需要扩大场景覆盖面才能在竞争中更有优势
白鳝的洞穴
539次阅读
2025-04-14 09:40:20
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
475次阅读
2025-04-17 17:02:24
一页概览:Oracle GoldenGate
甲骨文云技术
456次阅读
2025-04-30 12:17:56
GoldenDB数据库v7.2焕新发布,助力全行业数据库平滑替代
GoldenDB分布式数据库
451次阅读
2025-04-30 12:17:50