code: func getChain(addr string, config *tls.Config) (chain []*x509.Certificate, err error) {
  	var conn *tls.Conn
  	conn, err = tls.DialWithDialer(Dialer, Network, addr, config)
  	if err != nil {
  		return
  	}
  
  	err = conn.Close()
  	if err != nil {
  		return
  	}
  
  	chain = conn.ConnectionState().PeerCertificates
  	if len(chain) == 0 {
  		err = fmt.Errorf("%s returned empty certificate chain", addr)
  	}
  	return
  }
docs: // getChain is a helper function that retreives the host's certificate chain.