I have a set of a DSA client private key, client- and and a CA certificate files, which I would like to use with the kafka-go library. I have been trying to parse the files but have been unsuccessful. The aformentioned key and certificate files are correct, as they are being used in other places, written in Javascript though. I have been trying to parse them in the following manner:
func NewTLSConfig(clientCertFile, clientKeyFile, caCertFile string) (*tls.Config, error) {
tlsConfig := tls.Config{}
cert, err := tls.LoadX509KeyPair(clientCertFile, clientKeyFile
...
Where the string inputs are correct file paths. At this point I get the following error:
tls: failed to parse private key
which is coming from the parsePrivateKey function of the tls library. When checking the the function's input, it seems to be fine.
cert.PrivateKey, err = parsePrivateKey(keyDERBlock.Bytes)
The keyDERBlock object is populated, it has a proper type and bytes. What could be the issue? Thank you!
I have created a small Github repo to illustrate the issue.