2019-10-11 16:25:15 +01:00
|
|
|
// Package autocert is the ACME provider from golang.org/x/crypto/acme/autocert
|
|
|
|
// This provider does not take any config.
|
2019-10-09 16:42:05 +01:00
|
|
|
package autocert
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
|
2020-01-30 14:39:00 +03:00
|
|
|
"github.com/micro/go-micro/v2/api/server/acme"
|
2019-10-09 16:42:05 +01:00
|
|
|
"golang.org/x/crypto/acme/autocert"
|
|
|
|
)
|
|
|
|
|
|
|
|
// autoCertACME is the ACME provider from golang.org/x/crypto/acme/autocert
|
|
|
|
type autocertProvider struct{}
|
|
|
|
|
|
|
|
// NewListener implements acme.Provider
|
|
|
|
func (a *autocertProvider) NewListener(ACMEHosts ...string) (net.Listener, error) {
|
|
|
|
return autocert.NewListener(ACMEHosts...), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// New returns an autocert acme.Provider
|
|
|
|
func New() acme.Provider {
|
|
|
|
return &autocertProvider{}
|
|
|
|
}
|