import { createLogger } from "../utils/logger/index.js";
import { init_logger } from "../utils/logger.js";
//#region src/gateway/tls-server.ts
init_logger();
const log = createLogger("GatewayTls");
/** Native HTTPS for LAN/tailnet binds (Phase 2). Requires certPath/keyPath or autoGenerate. */
function resolveGatewayTlsRuntime(cfg) {
	const tls = cfg.gateway?.tls;
	if (!tls?.enabled) return { enabled: false };
	if (!tls.autoGenerate && (!tls.certPath?.trim() || !tls.keyPath?.trim())) {
		log.warn({ phase: "gateway_tls" }, "gateway.tls.enabled but certPath/keyPath missing and autoGenerate=false");
		return { enabled: false };
	}
	return {
		enabled: true,
		port: cfg.gateway?.port ?? 18790
	};
}
//#endregion
export { resolveGatewayTlsRuntime };

//# sourceMappingURL=tls-server.js.map