summaryrefslogtreecommitdiff
path: root/pkg/web
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/web')
-rw-r--r--pkg/web/certs.go2
-rw-r--r--pkg/web/handlers.go6
2 files changed, 7 insertions, 1 deletions
diff --git a/pkg/web/certs.go b/pkg/web/certs.go
index 8c5d423..9cccc65 100644
--- a/pkg/web/certs.go
+++ b/pkg/web/certs.go
@@ -31,7 +31,7 @@ type caInfo struct {
cacrt, cakey string
}
-func NewCaInfo(cacrt string, cakey string) caInfo {
+func newCaInfo(cacrt string, cakey string) caInfo {
return caInfo{cacrt, cakey}
}
diff --git a/pkg/web/handlers.go b/pkg/web/handlers.go
index c4f2e9a..b7675f5 100644
--- a/pkg/web/handlers.go
+++ b/pkg/web/handlers.go
@@ -8,6 +8,12 @@ type CertHandler struct {
Cainfo caInfo
}
+func NewCertHandler(caCrt, caKey string) CertHandler {
+ ci := newCaInfo(caCrt, caKey)
+ ch := CertHandler{ci}
+ return ch
+}
+
func (ch *CertHandler) CertResponder(w http.ResponseWriter, r *http.Request) {
ch.Cainfo.CertWriter(w)
}