func (le *LetsEncrypt) LoadCertificate(p string) *x509.Certificate {
	data, err := ioutil.ReadFile(p)
	if err != nil {
		return nil
	}

	// Decode FIRST certificate found in the certfile
	var certDERBlock *pem.Block
	certDERBlock, _ = pem.Decode(data)
	cert, err := x509.ParseCertificates(certDERBlock.Bytes)
	if err != nil || len(cert) == 0 {
		return nil
	}

	return cert[0]
}
// LoadCertificate loads a certificate from the given path or returns nil when no certificate is found.
LoadCertificate loads a certificate from the given path or returns nil when no certificate is found.
// LoadCertificate loads a certificate from the given path or returns nil when no certificate is found .
func (le *LetsEncrypt) LoadCertificate(p string) *x509.Certificate {
	data, err := ioutil.ReadFile(p)
	if err != nil {
		return nil
	}
	var certDERBlock *pem.Block
	certDERBlock, _ = pem.Decode(data)
	cert, err := x509.ParseCertificates(certDERBlock.Bytes)
	if err != nil || len(cert) == 0 {
		return nil
	}
	return cert[0]
}
func ( le * LetsEncrypt ) LoadCertificate ( p string ) * x509 . Certificate { data , err := ioutil . ReadFile ( p ) if err != nil { return nil } var certDERBlock * pem . Block certDERBlock , _ = pem . Decode ( data ) cert , err := x509 . ParseCertificates ( certDERBlock . Bytes ) if err != nil || len ( cert ) == 0 { return nil } return cert [ 0 ] }
LoadCertificate loads a certificate from the given path or returns nil when no certificate is found.
LoadCertificate loads a certificate from the given path or returns nil when no certificate is found .
// Decode FIRST certificate found in the certfile