client

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

Acmes Client

Install

go get github.com/aacfactory/acmes/client

Usage

ca, _ := ioutil.ReadFile("./cert.pem")
key, _ := ioutil.ReadFile("./key.pem")

acme, err := client.New(ca, key, "127.0.0.1:8443")
if err != nil {
    t.Error(err)
    return
}
_, cancel, obtainErr := acme.Obtain(context.TODO(), "*.foo.com")
if obtainErr != nil {
    t.Error(obtainErr)
    return
}
// to cancel auto renew
cancel()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	Resource []byte    `json:"resource"`
	Cert     []byte    `json:"cert"`
	Key      []byte    `json:"key"`
	NotAfter time.Time `json:"notAfter"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(caPEM []byte, caKeyPem []byte, host string) (v *Client, err error)

func (*Client) Obtain

func (c *Client) Obtain(ctx context.Context, domain string) (config *tls.Config, cancelAutoRenew func(), err error)

type HandleError

type HandleError struct {
	Cause string `json:"cause"`
}

Jump to

Keyboard shortcuts

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