1. _What did I do?_ `// mixed up order of key and cert:` `http.ListenAndServeTLS(..., key, cert, ...)` 2. _What happened?_ This resulted in the following cryptic error message: `crypto/tls: failed to parse certificate PEM data` 3. _What did I expect?_ I spent about an hour debugging various PEM format possibilities before finding the mixup. An error message explaining that the **type of PEM block was unexpected** would have saved me some time: `crypto/tls: failed to parse certificate PEM data, expected type "CERTIFICATE", got "PRIVATE KEY"` Related issue: https://github.com/golang/go/issues/7042
What did I do?
// mixed up order of key and cert:http.ListenAndServeTLS(..., key, cert, ...)What happened?
This resulted in the following cryptic error message:
crypto/tls: failed to parse certificate PEM dataWhat did I expect?
I spent about an hour debugging various PEM format possibilities before finding the mixup.
An error message explaining that the type of PEM block was unexpected would have saved me some time:
crypto/tls: failed to parse certificate PEM data, expected type "CERTIFICATE", got "PRIVATE KEY"Related issue: #7042