aboutsummaryrefslogtreecommitdiff
path: root/route.go
diff options
context:
space:
mode:
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) {