I have a Go application that reads and validates certificates, followed by a c++ application that uses the certificates from that location. Golang is automatically removing all (invalid) whitespace characters that are present in a certificate, and thus there are no validation errors, while the c++ application using openssl isn't able to parse this certificate.
block, _ := pem.Decode([]byte(pemString))
err := pem.Encode(os.Stdout, block)
if err != nil {
logrus.Fatal(err)
}
From above code, when I decode and encode a cert with whitespace, I get the result with all whitespace removed. Is there a way to identify if cert might have an issue with openssl?
I can check for whitespace, but I want to identify any and all problems that openssl can have with a certificate. Is there a better way to do this?
Sample example: https://play.golang.org/p/HvIRK99g33-