Start abstracting away the ACME provider (#830)

* Start abstracting away the ACME provider

* Move ACME to interface with sub-package implementations

* Addressing comments

* Library -> Provider

* Missed a couple of Library -> Provider

* One more Library -> Provider

* remove constants
This commit is contained in:
Jake Sanders
2019-10-09 16:42:05 +01:00
committed by Asim Aslam
parent 44473f954f
commit 107b7419b7
5 changed files with 69 additions and 8 deletions

View File

@@ -11,7 +11,6 @@ import (
"github.com/gorilla/handlers"
"github.com/micro/go-micro/api/server"
"github.com/micro/go-micro/util/log"
"golang.org/x/crypto/acme/autocert"
)
type httpServer struct {
@@ -55,7 +54,7 @@ func (s *httpServer) Start() error {
if s.opts.EnableACME {
// should we check the address to make sure its using :443?
l = autocert.NewListener(s.opts.ACMEHosts...)
l, err = s.opts.ACMEProvider.NewListener(s.opts.ACMEHosts...)
} else if s.opts.EnableTLS && s.opts.TLSConfig != nil {
l, err = tls.Listen("tcp", s.address, s.opts.TLSConfig)
} else {