Support requiring TLS for API access

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2026-03-06 16:24:06 -07:00
parent 779434331c
commit 395fa2c283
10 changed files with 30 additions and 16 deletions

View File

@@ -95,7 +95,7 @@ func HandleSystemOverlay(w http.ResponseWriter, req *http.Request) {
// If TLS is enabled, returns 403 Forbidden for plain-HTTP requests.
// If an explicit ?overlay= list is present, delegates to HandleOverlayList.
func HandleRuntimeOverlay(w http.ResponseWriter, req *http.Request) {
if config.Get().Warewulf.EnableTLS() && req.TLS == nil {
if config.Get().Warewulf.TLSEnabled() && req.TLS == nil {
wwlog.Denied("runtime overlay requested over insecure connection")
w.WriteHeader(http.StatusForbidden)
return