diff options
Diffstat (limited to 'route.go')
-rw-r--r-- | route.go | 12 |
1 files changed, 0 insertions, 12 deletions
@@ -1,7 +1,6 @@ package goxy import ( - "crypto/tls" "encoding/json" "fmt" "net/http" @@ -12,9 +11,6 @@ import ( // Routes defines a set of routes including correspondent TLS certificates type Routes map[string]Route -// SNI holds certificates -type SNI map[string]*tls.Certificate - type Route struct { Host, Upstream string Cert, Key []byte @@ -24,14 +20,6 @@ func (r Route) String() string { return fmt.Sprintf("%v → %v", r.Host, r.Upstream) } -// GetCertificate returns certificate for SNI negotiation -func (s SNI) getCertificate(h *tls.ClientHelloInfo) (*tls.Certificate, error) { - if v, ok := s[h.ServerName]; ok { - return v, nil - } - return nil, fmt.Errorf("no cert for %q", h.ServerName) -} - func (r Routes) ServeHTTP(w http.ResponseWriter, _ *http.Request) { for _, v := range r { fmt.Fprintln(w, v) |