aboutsummaryrefslogtreecommitdiff
path: root/route.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-04-04 02:30:57 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-04-04 02:30:57 +0200
commite890a66d5729ba3e1df5f28759bc228575a9ef44 (patch)
tree667e1866b3bf62de481a68b95aa60b9c7e049980 /route.go
parent16663e2524c0eea212bf5e9a0b3eccf5273c7fe2 (diff)
Cleanup
Diffstat (limited to 'route.go')
-rw-r--r--route.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/route.go b/route.go
index 04a488a..5f5d3ac 100644
--- a/route.go
+++ b/route.go
@@ -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) {