code: func (info *HostCertificateInfo) FromURL(u *url.URL, config *tls.Config) error {
  	addr := u.Host
  	if !(strings.LastIndex(addr, ":") > strings.LastIndex(addr, "]")) {
  		addr += ":443"
  	}
  
  	conn, err := tls.Dial("tcp", addr, config)
  	if err != nil {
  		switch err.(type) {
  		case x509.UnknownAuthorityError:
  		case x509.HostnameError:
  		default:
  			return err
  		}
  
  		info.Err = err
  
  		conn, err = tls.Dial("tcp", addr, &tls.Config{InsecureSkipVerify: true})
  		if err != nil {
  			return err
  		}
  	} else {
  		info.Status = string(types.HostCertificateManagerCertificateInfoCertificateStatusGood)
  	}
  
  	state := conn.ConnectionState()
  	_ = conn.Close()
  	info.FromCertificate(state.PeerCertificates[0])
  
  	return nil
  }
docs: // FromURL connects to the given URL.Host via tls.Dial with the given tls.Config and populates the HostCertificateInfo
  // via tls.ConnectionState.  If the certificate was verified with the given tls.Config, the Err field will be nil.
  // Otherwise, Err will be set to the x509.UnknownAuthorityError or x509.HostnameError.
  // If tls.Dial returns an error of any other type, that error is returned.