// RootFingerprint is a helper method that returns the current root fingerprint.
// It does an health connection and gets the fingerprint from the TLS verified
// chains.
RootFingerprint is a helper method that returns the current root fingerprint.
It does an health connection and gets the fingerprint from the TLS verified
chains.
// RootFingerprint is a helper method that returns the current root fingerprint . // It does an health connection and gets the fingerprint from the TLS verified // chains .
func (c *Client) RootFingerprint() (string, error) {
	u := c.endpoint.ResolveReference(&url.URL{Path: "/health"})
	resp, err := c.client.Get(u.String())
	if err != nil {
		return "", errors.Wrapf(err, "client GET %s failed", u)
	}
	if resp.TLS == nil || len(resp.TLS.VerifiedChains) == 0 {
		return "", errors.New("missing verified chains")
	}
	lastChain := resp.TLS.VerifiedChains[len(resp.TLS.VerifiedChains)-1]
	if len(lastChain) == 0 {
		return "", errors.New("missing verified chains")
	}
	return x509util.Fingerprint(lastChain[len(lastChain)-1]), nil
}
func ( c * Client ) RootFingerprint ( ) ( string , error ) { u := c . endpoint . ResolveReference ( & url . URL { Path : " " } ) resp , err := c . client . Get ( u . String ( ) ) if err != nil { return " " , errors . Wrapf ( err , " " , u ) } if resp . TLS == nil || len ( resp . TLS . VerifiedChains ) == 0 { return " " , errors . New ( " " ) } lastChain := resp . TLS . VerifiedChains [ len ( resp . TLS . VerifiedChains ) - 1 ] if len ( lastChain ) == 0 { return " " , errors . New ( " " ) } return x509util . Fingerprint ( lastChain [ len ( lastChain ) - 1 ] ) , nil }
RootFingerprint is a helper method that returns the current root fingerprint.
RootFingerprint is a helper method that returns the current root fingerprint .