Im currently trying to use this function for my http server. I already have the cert.pem and the private.key but I am getting this error
crypto/tls: failed to parse private key
No idea what is wrong. This is the correct key because any other key will just throw
private key does not match public key
They are both on the same folder
Since I am not sure how risky is to expose the key. It starts with this
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,D353D2D8ACDA5320
....
---END RSA PRIVATE KEY-----
The code I am using
err := http.ListenAndServeTLS(":80", "mycert.pem", "private.key", router)
if err != nil {
log.Fatal(err)
}