Add auth over ALPN (#5)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-03-22 20:17:23 -04:00
1 parent 5acda6a0b1
commit cad3c24f54
11 files changed
+278 -234

No files matched your search

+14
View File
@@ -5,6 +5,7 @@ import (
"fmt"
"io"
"net"
"net/http"
"strings"
"time"
@@ -20,6 +21,19 @@ import (
"github.com/pires/go-proxyproto"
)
type ServerListener struct {
Mux *alpnmux.ALPNMux
Config *configutil.Listener
HTTPServer *http.Server
ALPNListener net.Listener
}
type WorkerAuthCertInfo struct {
CACertPEM []byte `json:"ca_cert"`
CertPEM []byte `json:"cert"`
KeyPEM []byte `json:"key"`
}
// Factory is the factory function to create a listener.
type ListenerFactory func(*configutil.Listener, io.Writer, cli.Ui) (*alpnmux.ALPNMux, map[string]string, reloadutil.ReloadFunc, error)
-10
View File
@@ -8,8 +8,6 @@ import (
"errors"
"fmt"
"io"
"net"
"net/http"
"os"
"sort"
"strconv"
@@ -18,7 +16,6 @@ import (
"github.com/armon/go-metrics"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/go-alpnmux"
"github.com/hashicorp/go-hclog"
wrapping "github.com/hashicorp/go-kms-wrapping"
"github.com/hashicorp/go-multierror"
@@ -38,13 +35,6 @@ import (
_ "github.com/lib/pq"
)
type ServerListener struct {
Mux *alpnmux.ALPNMux
Config *configutil.Listener
HTTPServer *http.Server
ALPNListener net.Listener
}
type Server struct {
InfoKeys []string
Info map[string]string