code: func fetchRemoteCertificate(certURL string) (fi *fetchedIntermediate, err error) {
  	log.Debugf("fetching remote certificate: %s", certURL)
  	var resp *http.Response
  	resp, err = http.Get(certURL)
  	if err != nil {
  		log.Debugf("failed HTTP get: %v", err)
  		return
  	}
  
  	defer resp.Body.Close()
  	var certData []byte
  	certData, err = ioutil.ReadAll(resp.Body)
  	if err != nil {
  		log.Debugf("failed to read response body: %v", err)
  		return
  	}
  
  	log.Debugf("attempting to parse certificate as DER")
  	crt, err := x509.ParseCertificate(certData)
  	if err != nil {
  		log.Debugf("attempting to parse certificate as PEM")
  		crt, err = helpers.ParseCertificatePEM(certData)
  		if err != nil {
  			log.Debugf("failed to parse certificate: %v", err)
  			return
  		}
  	}
  
  	log.Debugf("certificate fetch succeeds")
  	fi = &fetchedIntermediate{Cert: crt, Name: constructCertFileName(crt)}
  	return
  }
docs: // fetchRemoteCertificate retrieves a single URL pointing to a certificate
  // and attempts to first parse it as a DER-encoded certificate; if
  // this fails, it attempts to decode it as a PEM-encoded certificate.