certificate

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package certificate contains functions for handling TLS certificates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchPEM

func FetchPEM(hostname string) ([]byte, error)

FetchPEM retrieves the certificate chain presented by the server listening at hostname in PEM format.

Adapted from https://stackoverflow.com/a/46735876/491710

func LoadPEM

func LoadPEM(path string) (*x509.CertPool, error)

LoadPEM loads certificates from a PEM file and returns a cert pool containing the certificates.

func ValidateConnection

func ValidateConnection(pool *x509.CertPool, fleetURL string) error

ValidateConnection checks that a connection can be successfully established to the server URL using the cert pool provided. The validation performed is not sufficient to verify authenticity of the server, but it can help to catch certificate errors and provide more detailed messages to users.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL