Andrew Arrow
Andrew Arrow

Reputation: 4585

How do I fix my PEM block in ssl certificate?

Using golang and gin for an SSL webserver. I made my csr and key files. But I get:

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

Any idea where to go from here? The line that reads the file is:

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

I made my files with:

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

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

Upvotes: 3

Views: 11856

Answers (1)

Andrew Arrow
Andrew Arrow

Reputation: 4585

I was confusing .csr file vs a .crt file.

Upvotes: 6

Related Questions