如何在ssl证书中修复PEM块?

时间:2016-05-05 21:09:00

标签: ssl go ssl-certificate

使用golang和gin作为SSL网络服务器。我制作了我的csr和密钥文件。但我明白了:

crypto/tls: failed to find "CERTIFICATE" PEM block in certificate input
after skipping PEM blocks of the following types: [CERTIFICATE REQUEST]

知道从哪里开始?读取文件的行是:

https://github.com/gin-gonic/gin/blob/develop/gin.go#L230

我用以下文件制作了文件:

openssl genrsa -des3 -out <private key file name>.key 2048

openssl req -new -key <private key file name>.key -out <csr file name>.csr 

1 个答案:

答案 0 :(得分:1)

我把.csr文件与.crt文件混淆了。