Replace 30+ files with upstream's exact versions to eliminate merge conflicts. Fork-only additions (interfaces, struct fields, methods) are re-added at non-conflicting positions or in separate _ext.go files. Files replaced: READMEs, CI configs, docs, Makefile, and ~20 Go source files with <30 line diffs from upstream. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
668 B
Go
28 lines
668 B
Go
package health
|
|
|
|
import (
|
|
"crypto/tls"
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
// Mux returns the underlying ServeMux so additional routes can be registered.
|
|
func (s *Server) Mux() *http.ServeMux {
|
|
return s.server.Handler.(*http.ServeMux)
|
|
}
|
|
|
|
// StartTLS starts the server with TLS using the provided certificate and key files.
|
|
func (s *Server) StartTLS(certFile, keyFile string) error {
|
|
s.mu.Lock()
|
|
s.ready = true
|
|
s.mu.Unlock()
|
|
|
|
cert, err := tls.LoadX509KeyPair(certFile, keyFile)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to load TLS cert: %w", err)
|
|
}
|
|
s.server.TLSConfig = &tls.Config{
|
|
Certificates: []tls.Certificate{cert},
|
|
}
|
|
return s.server.ListenAndServeTLS("", "")
|
|
}
|