Skip to content

Commit

Permalink
crypto/tls: document certificate chains in LoadX509KeyPair
Browse files Browse the repository at this point in the history
Fixes golang#15348

Change-Id: I9e0e1e3a26fa4cd697d2c613e6b4952188b7c7e1
Reviewed-on: https://go-review.googlesource.com/23150
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
Scott Bell authored and bradfitz committed May 16, 2016
1 parent 07b6287 commit 6885da9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tls.go
Expand Up @@ -170,10 +170,11 @@ func Dial(network, addr string, config *Config) (*Conn, error) {
return DialWithDialer(new(net.Dialer), network, addr, config)
}

// LoadX509KeyPair reads and parses a public/private key pair from a pair of
// files. The files must contain PEM encoded data. On successful return,
// Certificate.Leaf will be nil because the parsed form of the certificate is
// not retained.
// LoadX509KeyPair reads and parses a public/private key pair from a pair
// of files. The files must contain PEM encoded data. The certificate file
// may contain intermediate certificates following the leaf certificate to
// form a certificate chain. On successful return, Certificate.Leaf will
// be nil because the parsed form of the certificate is not retained.
func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) {
certPEMBlock, err := ioutil.ReadFile(certFile)
if err != nil {
Expand Down

0 comments on commit 6885da9

Please sign in to comment.