Skip to content

Commit

Permalink
Added HTTPHandler() to the CertManager interface after support for HT…
Browse files Browse the repository at this point in the history
…TP-01 challenges was added
  • Loading branch information
kpumuk committed Sep 30, 2024
1 parent f2f6f9c commit 30b8c20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/server/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package server
import (
"crypto/tls"
"log/slog"
"net/http"
"sync"
)

type CertManager interface {
GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
HTTPHandler(handler http.Handler) http.Handler
}

// StaticCertManager is a certificate manager that loads certificates from disk.
Expand Down Expand Up @@ -53,3 +55,7 @@ func (m *StaticCertManager) GetCertificate(*tls.ClientHelloInfo) (*tls.Certifica

return m.cert, nil
}

func (m *StaticCertManager) HTTPHandler(handler http.Handler) http.Handler {
return handler
}

0 comments on commit 30b8c20

Please sign in to comment.