aboutsummaryrefslogtreecommitdiff
path: root/internal/admin
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 16:13:49 -0400
committerhistoria <[not public]>2026-09-18 16:13:49 -0400
commit194164a77eb4f2479b94c19e6f0e1278ab608781 (patch)
tree53413add8ed6f32a34d1733397e380cc98ef70ef /internal/admin
parent67e01aab85607b9e601185c7d62dff576af3bb43 (diff)
downloadthehouseoficarus-194164a77eb4f2479b94c19e6f0e1278ab608781.tar.gz
fix: more casino, economy, gameplay, security, and world data hardening gaps
Diffstat (limited to 'internal/admin')
-rw-r--r--internal/admin/server.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/admin/server.go b/internal/admin/server.go
index c13fe96..98400c2 100644
--- a/internal/admin/server.go
+++ b/internal/admin/server.go
@@ -740,6 +740,11 @@ func (s *AdminServer) accountFromCookie(r *http.Request) string {
}
func loadOrGenerateCert(cfg *config.Config) (tls.Certificate, error) {
+ // A half-configured cert pair must fail loudly instead of silently serving
+ // a self-signed certificate (see the game-server equivalent).
+ if (cfg.TLS.CertFile == "") != (cfg.TLS.KeyFile == "") {
+ return tls.Certificate{}, fmt.Errorf("admin_https: tls.cert_file and tls.key_file must be set together")
+ }
if cfg.TLS.CertFile != "" && cfg.TLS.KeyFile != "" {
return tls.LoadX509KeyPair(cfg.TLS.CertFile, cfg.TLS.KeyFile)
}