aboutsummaryrefslogtreecommitdiff
path: root/route.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-04-04 03:06:09 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-04-04 03:06:09 +0200
commit73eb3e3c586b3ce039aadbd432a29b002df00f73 (patch)
tree2d379d52e7aacb2cc78ed69fb01f4f2d3353eb33 /route.go
parenteb00f8e625b27f3193a204deec68337d9ba7307f (diff)
Cleanup SNI
Diffstat (limited to 'route.go')
-rw-r--r--route.go12
1 files changed, 0 insertions, 12 deletions
diff --git a/route.go b/route.go
index 5f5d3ac..e4de1de 100644
--- a/route.go
+++ b/route.go
@@ -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)