diff options
| author | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
| commit | 194164a77eb4f2479b94c19e6f0e1278ab608781 (patch) | |
| tree | 53413add8ed6f32a34d1733397e380cc98ef70ef /internal/net/server.go | |
| parent | 67e01aab85607b9e601185c7d62dff576af3bb43 (diff) | |
| download | thehouseoficarus-194164a77eb4f2479b94c19e6f0e1278ab608781.tar.gz | |
fix: more casino, economy, gameplay, security, and world data hardening gaps
Diffstat (limited to 'internal/net/server.go')
| -rw-r--r-- | internal/net/server.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/net/server.go b/internal/net/server.go index 05a98d1..f56aebb 100644 --- a/internal/net/server.go +++ b/internal/net/server.go @@ -233,7 +233,7 @@ func (s *Server) sessionIdleTimeout(sess *Session) time.Duration { // anonymous flood targets), everything else gets a generous idle timeout. func sessionIdleTimeout(sess *Session) time.Duration { switch sess.State() { - case StateAccountName, StatePassword: + case StateAccountName, StatePassword, StateNewAccountPass, StateNewAccount: return loginReadTimeout default: return idleReadTimeout @@ -555,6 +555,11 @@ func NewServer(cfg *config.Config) (*Server, error) { } func loadOrGenerateCert(cfg *config.Config, service string) (tls.Certificate, error) { + // A half-configured cert pair must fail loudly: silently falling back to a + // self-signed cert makes clients fail verification with a confusing error. + if (cfg.TLS.CertFile == "") != (cfg.TLS.KeyFile == "") { + return tls.Certificate{}, fmt.Errorf("%s: tls.cert_file and tls.key_file must be set together", service) + } if cfg.TLS.CertFile != "" && cfg.TLS.KeyFile != "" { return tls.LoadX509KeyPair(cfg.TLS.CertFile, cfg.TLS.KeyFile) } |
