Remove trailing/leading spaces in Certificates (#5885)

Fixes:  #5632
This commit is contained in:
Praveen raj Mani 2018-05-09 14:26:38 +05:30 committed by Nitish Tiwari
parent deb685c5b5
commit 3971483e18

View File

@ -17,6 +17,7 @@
package cmd
import (
"bytes"
"crypto"
"crypto/ecdsa"
"crypto/tls"
@ -38,6 +39,9 @@ func parsePublicCertFile(certFile string) (x509Certs []*x509.Certificate, err er
return nil, err
}
// Trimming leading and tailing white spaces.
data = bytes.TrimSpace(data)
// Parse all certs in the chain.
current := data
for len(current) > 0 {