From 2e8c207ebc1e0b36215928f6b2cccf455acd1e94 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Fri, 15 Nov 2024 14:42:01 +0800 Subject: [PATCH] =?UTF-8?q?Updated=20=E7=94=9F=E6=88=90SSL=E8=87=AA?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E8=AF=81=E4=B9=A6=E5=B9=B6=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=20(markdown)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 生成SSL自签名证书并测试.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/生成SSL自签名证书并测试.md b/生成SSL自签名证书并测试.md index d4708d8..166c890 100644 --- a/生成SSL自签名证书并测试.md +++ b/生成SSL自签名证书并测试.md @@ -34,9 +34,9 @@ subject=/C=cn/ST=gd/L=sz/O=company/OU=section/CN=zlm.com/emailAddress=xiachu@qq. Getting Private key ``` -# 4、合并公钥私钥 +# 4、合并公钥私钥(需要私钥在前) ```bash -cat server.crt server.key > ./ssl.pem +cat server.key server.crt > ./ssl.pem ``` # 5、加载证书 @@ -45,3 +45,15 @@ cat server.crt server.key > ./ssl.pem ``` ![图片.png](https://upload-images.jianshu.io/upload_images/8409177-a3e64c0c8b642521.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) + +# 6、如果第5步报错,检查格式是否正确 +```bash +cat ./ssl.pem +-----BEGIN RSA PRIVATE KEY----- +base64内容 +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +base64内容 +-----END CERTIFICATE----- +``` +如果不是-----BEGIN RSA PRIVATE KEY----- 可以重新开始第4部,将文件调换下顺序,重新合并 \ No newline at end of file