diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2016-04-04 02:30:57 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2016-04-04 02:30:57 +0200 |
commit | e890a66d5729ba3e1df5f28759bc228575a9ef44 (patch) | |
tree | 667e1866b3bf62de481a68b95aa60b9c7e049980 /route.go | |
parent | 16663e2524c0eea212bf5e9a0b3eccf5273c7fe2 (diff) |
Cleanup
Diffstat (limited to 'route.go')
-rw-r--r-- | route.go | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -3,7 +3,6 @@ package goxy import ( "crypto/tls" "encoding/json" - "errors" "fmt" "net/http" "net/url" @@ -26,12 +25,11 @@ func (r Route) String() string { } // GetCertificate returns certificate for SNI negotiation -func (s SNI) GetCertificate(h *tls.ClientHelloInfo) (*tls.Certificate, error) { - host := h.ServerName - if v, ok := s[host]; ok { +func (s SNI) getCertificate(h *tls.ClientHelloInfo) (*tls.Certificate, error) { + if v, ok := s[h.ServerName]; ok { return v, nil } - return nil, errors.New("no cert for " + host) + return nil, fmt.Errorf("no cert for %q", h.ServerName) } func (r Routes) ServeHTTP(w http.ResponseWriter, _ *http.Request) { |