Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
crypto/tls: X509KeyPair skips over invalid pem blocks but doesn't error #7042
What steps will reproduce the problem? If possible, include a link to a program on play.golang.org. 1. Put three pem certs together in a file, but put the second one's BEGIN line on the same line as the first one's end 2. Load with LoadX509KeyPair or X509KeyPair. 3. See 2 certificates loaded (the first and the last) but the second one is silently skipped What is the expected output? Error when the file doesn't parse. What do you see instead? Loads the first and third certs with no acknowledgment of the second one. Which operating system are you using? This occurs on OS X and Linux Which version are you using? (run 'go version') go version go1.2 darwin/amd64 `openssl x509` manages to error out both in this case and when the certs are broken up incorrectly and the trailing dashes on the first is less by one than expected and the leading dashes on the second is greater by one than expected.